LATEST VERSION: 1.8 - CHANGELOG
Push Notification Services v1.8

Windows Phone 8.1 Push Client SDK

Sample App

You can find the Windows Phone Sample App on github

Features

The Pivotal Cloud Foundry Mobile Services Push Client SDK is a light-weight library that will help your application register with Windows Notification Service (WNS) and an instance of the PCF Mobile Services Push Notification server.

The SDK does not provide any code for handling remote push notification.

Device Requirements

The Push SDK requires WP8.1.

Getting Started

In order to receive push messages from the Push Server in your WP8.1 application, you will need to follow these steps:

  1. You must have a Windows Store account, and your app must be registered with the windows store, and must you have a certificate for receiving pushes. Follow the instructions here:

http://msdn.microsoft.com/en-us/library/windows/apps/hh465407.aspx

Finally, you need to associate your app with the windows store. Right click on your project in Visual Studio. Select Store. Select ‘Associate App with the Store…’ Follow Microsoft’s on-screen instructions to complete app-to-store association.

  1. Set up your application, environment, and a variant on the PCF Mobile Services administration console. This task is beyond the scope of this document, but please note you will need the TLS certificate above. After setting up your variant in PCF Mobile Services, make sure to note the Variant UUID and Variant Secret parameters. You will need them below.

  2. Add a reference to the SDK NuGet package to your project. If you don’t have access to the NuGet, you could simply obtain the compiled DLL files. Please contact the PCF Mobile Services team for help.

  3. Add the following lines of code to the initialization section of your application.

    MSSParameters parameters = new MSSParameters(variant_uuid, variant_secret, base_server_url, server_name, device_alias, tags);
    await MSSPush.SharedInstance.RegisterForPushAsync(parameters);
    

The variant_uuid, variant_secret, and server_name are described above. The base_server_url parameter is the base url of your push server. The device_alias parameter is a custom field that you can use to differentiate this device from others in your own push messaging campaigns; can be null. The tags parameter is a custom field that you can use to differentiate registrations in your own push messaging campaigns; can be null.

You should only have to call RegisterForPushAsync once in the lifetime of your process - but calling it more times is not harmful. The RegisterForPushAsync method is asynchronous and will return before registration is complete. To know when registration is complete (or if it fails) and obtain the PushNotificationChannel, provide an Action<PushNotificationChannel> as the second argument.

The PCF Mobile Services Push SDK takes care of the following tasks for you:

  • Registering with WNS.
  • Sending your push notification channel URI to the back-end (i.e.: the PCF Mobile Services).
  • Re-registering after the push notification channel URI or any other registration parameters are updated.
Create a pull request or raise an issue on the source for this page in GitHub