Push Notifications in Native Windows Phone 8 Applications
This tutorial explains how to configure a MobileFirst Native Windows Phone 8 application to support push notifications.
Also mentioned are the addresses and ports that are required for notifications to arrive to the supported Microsoft Push Notification Service vendor (MPNS).
Prerequisite: Make sure that you read the Configuring a native Windows Phone 8 application with the MobileFirst Platform SDK tutorial first.
Setting up the project
To send push notifications to Windows Phone 8 devices, use the Microsoft Push Notifications Service (MPNS).
- Non-authenticated push notification does not require any setup from the developer. Authenticated push notification requires a Windows Phone Dev Center account.
- To use authenticated push, you must use a certificate that is issued by a Microsoft-trusted root certificate authority. For production, consider using authenticated push notification in order to ensure that the information is not compromised.
Create a MobileFirst project.
Add a MobileFirst Windows Phone 8 native API. The native API project provides the files that are necessary to build a Windows Phone 8 app.
Add the pushSender element under the nativeWindows8App environment (these settings are also editable with the Application Descriptor Editor in Design mode).
- Non-authenticated push
- Authenticated push
- Replace serviceName value with the service name.
- Replace keyAlias value with the certificate alias.
- Replace keyAliasPassword value with the certificate password.
- Non-authenticated push
wlclient.propertiesfile in your native Windows Phone 8 project and enter appropriate values for the following fields:
wlServerHost- The host name or IP address of the MobileFirst Server instance.
wlServerPort- The port on which MobileFirst Server is listening.
wlServerContext- The context root of your MobileFirst Server instance.
- wlMPNSServiceName = Add the MPNS service name for authenticated push.
Modify the native Windows Phone 8 project.
Properties\WMAppManifest.xmlfile and add the following capabilities:
For more information about using the certificate file, see the topic about setting up push notifications for Windows Phone 8, in the user documentation.
Windows Phone 8 Push Notifications Service
No specific port needs to be open in your server configuration.
MPNS uses regular http or https requests.
- Event Source Notifications in Native Windows Phone 8 Applications
- Tag and Broadcast Notifications in Native Windows Phone 8 Applications