+

Search Tips   |   Advanced Search

Set up push notifications for Windows Phone 8

We can set up a web service to provide authenticated or unauthenticated push notification on Windows Phone 8.

To use an authenticated push notification service, we must first set up a Secure Sockets Layer (SSL) certificate keystore. See SSL certificate keystore setup. The keystore can contain several certificates, one of which is the certificate for authenticated push notifications to Microsoft Push Notification Service (MPNS).

We must also authenticate the web service with Microsoft, as documented in the Windows Phone Development Center at http://dev.windowsphone.com/en-us/develop/.

Authenticated web services have no daily limit on the number of push notifications they can send, whereas unauthenticated web services are limited to a rate of 500 push notifications per subscription per day.

For unauthenticated push, no specific setup is required, as shown in the example at the end of this procedure.

Practically, consider authenticated push notification for production, to protect your data, and non-authenticated push at development time only.

In application-descriptor.xml, for <windowsPhone8>, set the following attributes for the <pushSender> element.

Attribute Setting
serviceName The common name (CN) found in the MPNS certificate's Subject value.
keyAlias The alias used to access the keystore that the following properties specify in worklight.properties:

  • ssl.keystore.path

  • ssl.keystore.type

  • ssl.keystore.password

keyAliasPassword Password for the key alias.


Results

The serviceName attribute from the application descriptor is passed to the application's client side, and is used when a new notification channel is created. The URI token of the notification channel starts with https, rather than http. MobileFirst Server uses the keyAlias and keyAliasPassword attributes to extract the certificate from the Java keystore file, so the handshake process with MPNS can use that certificate. Any push notifications that are eventually submitted to the application are authenticated and secure.

In response to push notification requests, MPNS returns a response code and a status. If the request is successful, the response code is 200, and the status is Received. For details of other response codes, go to the MSDN website at msdn.microsoft.com, and search for "push notification service response codes".


Example


Parent topic: Set up push notifications