Posts Tagged ‘.Net’

iOS Push Notifications in C# with apns-sharp

November 28, 2010

I just recently set up push notification in an iOS application for the first time. The back-end is implemented in C# and searching the web for existing solutions i came across “apns-sharp” ( “apns” is short for Apple Push Notification Service and the library, as you would expect, provides a C# api for sending iOS push notifications. The library also contains an api for Apple’s Feedback service for – a service used to retrieve push tokens that are no longer valid, so as to be able to clean up subscribtions.

Initially i got things working on my dev setup without hardly any effort. I then proceeded to publish the project to by budget webhost and suddenly I wasn’t receiving notifications anymore. It took me quite some time to figure out what was wrong…



February 3, 2008

A small and helpful class that I find myself adding to every single project I start these day is ”GenericEventArgs”.

Microsoft included the System.EvenHandler<T> class in .NET, taking away the need to create custom delegates to enable the use of custom event arguments . This class takes it one step further. It’s a simple generic class with the signature EventArgs<T>, deriving from System.EventArgs. It accepts a single instance of T thru the constructor which it exposes via a property “Value” of the type T.

Now where I would earlier create custom eventarg classes to pass a single argument with an event, I simply use this generic implementation.


Model View Presenter (MVP) – My first post!

January 27, 2008

Hello all and welcome to Mr. Rask on the web.

For this my first post i have composed a basic introduction to my favorite design pattern: Model View Presenter or MVP for short. The implementation presented in the article is pretty much exactly how i do it at the office office every day.

Model View Presenter is all about seperating user interface logic from graphical implementation. If you have ever build applications using a graphical library like Windows Form, you know how easily user interface code can get cluttered. MVP to the rescue.

Article (.PDF): Model View Presenter (MVP)
Source (C# 3.0 / VS2008): Crappy filehosting died, so if you want it just drop a comment.

Last but not least any feedback is much appreciated. So pretty please – with sugar on top – drop a comment if you find what you read here usefull (or even if you don’t – i just want to hear from you 🙂 )

All the best
Olav Rask