Setting up push notifications for Windows Phone Silverlight 8

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

Before you begin

To use an authenticated push notification service, you must first set up a Secure Sockets Layer (SSL) certificate keystore. For more information, 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).

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

About this task

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.

Procedure

In the application-descriptor.xml file, 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 that is used to access the keystore that the following properties specify in the worklight.properties file:
  • ssl.keystore.path
  • ssl.keystore.type
  • ssl.keystore.password
keyAliasPassword The password for your 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 that 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

  • For authenticated push notification:
    <windowsPhone8>
      <pushSender>
        <authenticatedPush serviceName="myservice"
                           keyAlias="janedoe"
                           keyAliasPassword="a1b2c3d4"></authenticatedPush>
      </pushSender>
    ...
    </windowsPhone8>
  • For unauthenticated push notification:
    <windowsPhone8>
      <pushSender/>
       ...
    </windowsPhone8>