drupal hit counter
Jerry Huang | All posts tagged 'push notification'

Jerry Huang apps and developing apps

WP7 push notification summary

7. November 2011 17:04 by Jerry in Windows Phone Development

First of all, here is a high level briefing how push notification works and what have been involved.

Parties:
1) your phone application: register push service; receiving notifications
2) your server: sending messages
3) the so-called "Windows Azure": microsoft server (MPNS, Microsoft push notification services), assignning token to your application; forwarding alerts (sent from your server) to your application

Now let's see how it actually works.

step 1) Your application will first register with Azure, and will be assigned back an URI (token) if the registration is successful. P.S: the token is unique per application per device, so that one token would be able to tell the Azure which app on which phone.

step 2) Your application must tell your own server that what URI has been returned (by calling a web service would be classic). It's your job to maintain the subscriber list on your server side. Once a condition is met for sending out an alert to a device, your server application will then use the URI (that previous notified by your app) to send a message (which its format is pre-define by Microsoft) to Azure service.

step 3) Eventually the message will then be transfered to target device via Azure service.

For the details of implementing these steps, I'm pretty sure you would be able to find a bunch of samples and resources via Mr. Google. So, go for itwink

Next, there are 3 types of notification currently supported by WP7.0 and 7.1:

1) Raw. Custom format, maximum 1KB for the message. The message will be discarded ("Suppressed" status) by Azure if your app is not currently running on the phone.

2) Tile. User must "pin to start" your app, otherwise, the message will be discarded ("Suppressed" status) by Azure. The image URI could be pointing to remote (internet) or local (within the phone), as long as it's valid. For remote image, the size must be less than 80KB and the download time has to be less than 1 minute.

3) Toast. If the phone is switch off, the message will have the connection status "TempDisconnected"

What else you may need to know? Here you go...

1) MSDN: http://msdn.microsoft.com/en-us/library/ff402558(v=vs.92).aspx

2) 500 messages per application per device per 24 hours if your server doesn't use SSL to communicate with Azure. By using SSL, you will need to upload your cert via your developer account, and then this limitation is not applicable on your apps. details: http://msdn.microsoft.com/en-us/library/ff941099(v=VS.92).aspx. Last but not least for this issue, a very stupid action is required that you must upload the cert every 4 months if the post here is ture (which most likely is): http://forums.create.msdn.com/forums/t/85207.aspx