Push Notifications in Native Windows 8 Universal Applications

improve this page | report issue

Overview

This tutorial explains how to configure a MobileFirst Native Windows Universal application to support push notifications.
Also mentioned are the addresses and ports that are required for notifications to arrive to the supported Windows Push Notification Services vendor (WNS).

Prerequisite: Make sure that you read the Configuring a native Windows Universal application with the MobileFirst Platform SDK tutorial first.

Setting up push notification

To send push notifications to Windows Universal devices, use Windows Push Notification Services (WNS).
As a developer, you need to register your app with Windows Store through the Windows Dev Center by using your Microsoft account.

For more information about how to get WNS credentials (which you will use later in the MobileFirst project), see http://msdn.microsoft.com/en-in/library/windows/apps/hh465407.aspx

Server side

In the application-descriptor.xml file, Add the pushSender element under the nativeWindows8App environment (these settings are also editable with the Application Descriptor Editor in Design mode).

<nativeWindows8App id="AppName" platformVersion="7.0.0.00.20150312-0731"
	version="1.0" xmlns="http://www.worklight.com/native-windows8-descriptor">
	<displayName>AppName</displayName>
	<description>AppName</description><
	<pushSender clientSecret="" packageSID=""/>
</nativeWindows8App>

Use the values that you previously generated in the Windows Store Dashboard:

  • Replace clientSecret value with the secret key.
  • Replace packageSID value with the package security identifier.

Client side

Set the Identity Name and Publisher values manually in the package manifest or associate your native project with the application in the Windows Store by right-clicking the project and selecting Store->Associate App with the Store.

If you want your app to support toast notification, add the ToastCapable="true" attribute to the VisualElements element in the package manifest.

<Applications><br />
    <Application Id="App" ...>
        <VisualElements  ... ToastCapable="true">
         ...
        </VisualElements>
    </Application>
</Applications><

For more information about setting up your native Windows Universal application for push notification, see the topic about "Setting up push notifications for Windows Universal" in the user documentation.

Windows Universal Push Notifications Service

No specific port needs to be open in your server configuration.
WNS uses regular http or https requests.

Notification Types

Inclusive terminology note: The Mobile First Platform team is making changes to support the IBM® initiative to replace racially biased and other discriminatory language in our code and content with more inclusive language. While IBM values the use of inclusive language, terms that are outside of IBM's direct influence are sometimes required for the sake of maintaining user understanding. As other industry leaders join IBM in embracing the use of inclusive language, IBM will continue to update the documentation to reflect those changes.
Last modified on November 09, 2016