views:

713

answers:

1

Here's the overview.

I need to add push notification to an iPhone app. Server side is ASP.NET in c#.

What I would like is some coaching to work through the process. I will then post generic code for an iPhone project and an ASP.NET web app along with step-by-step instructions so that others can learn.

Here is my understanding:

  1. Apply for APNS certificate and add it to keychain. (Not sure how to bring this to ASP.NET)
  2. Have iPhones register with registerForRemoteNotificationWithTypes, send the value to your server, and store in a DB. Seems like this code to register should be easy but I can't find a good sample. (No problem with sending the value to the ASP.NET server.)
  3. Your server app creates a payload string, does JSON encoding, sends to the APNS server for each (or can it be for groups) of iPhones using their device token that was saved into the DB.

So to develop the addition, here are the pieces:

  • The iPhone registration code

  • Code that sends iPhone registration code to server and saves to DB (this is easy and I already have these pieces).

  • The server side APNS contact code in c#. This also includes how to use the certificate that was generated on the Apple Developer web site.

  • Also, can the payload be a multiple choice question that can be answered with the result sent back to the server?

Thanks in advance for the help. I will turn this in to a tutorial for others.

+2  A: 

So for the C# push part theres an open source project which you can use, its easy and has some sample code of how to use the libraries in order to send push notificaitons here is a link C# push notification project

Basically all you gotta do is get the push certificate from apple, then drop it in your project and open it in the C# project (you can view the example and where to do it will be obvious)...

The iphone part of pretty trivial and there are tons of examples out there

Daniel