Tag and Broadcast Notifications in Native Windows Phone 8 Applications
Prerequisite: Make sure that you read the Push notifications in native Windows Phone 8 applications tutorial first.
Tag notifications are notification messages that are targeted to all the devices that are subscribed to a particular tag.
Tags represent topics of interest to the user and provide the ability to receive notifications according to the chosen interest.
Broadcast notifications are a form of tag push notifications that are targeted to all subscribed devices. Broadcast notifications are enabled by default for any push-enabled MobileFirst application by a subscription to a reserved
Push.all tag (auto-created for every device). This ability can be disabled by by unsubscribing from the reserved
Tag Notifications configuration
Setting up tags
Tags are defined in the
API methods for tag notifications
Subscribes the device to the specified tag name.
Unsubscribes the device from the specified tag name.
Returns whether the device is subscribed to a specified tag name.
Common API methods for tag and broadcast notifications
Defines the callback method to be notified when the notification arrives.
WLNotificationListeneris called when a push notification is received by the device.
props- A JSON block that contains the notification properties of the platform.
payload- A JSON block that contains other data that is sent from MobileFirst Server. It also contains the tag name for tag-based and broadcast notification. The tag name appears in the "tag" element. For broadcast notification, the default tag name is
This method submits a notification based on the specified target parameters and takes two mandatory parameters:
applicationId- (mandatory) The name of the MobileFirst application
notificationOptions- (mandatory) A JSON block containing message properties
For a full list of message properties, refer to the
WL.Server.sendMessageAPI in the API reference of the user documentation.
TagNotificationsproject contains a MobileFirst native API that you can deploy to your MobileFirst server.
TagNotificationsWP8project contains a native Windows Phone 8 application that uses a MobileFirst native API library to subscribe for push notifications and receive notifications from MPNS.
- Make sure to update the
wlclient.propertiesfile in the native project with the relevant server settings.
Sending a notification
To test the application is able to receive a push notification you can perform one of the following:
- From MobileFirst Studio, right-click the adapter folder, select Call MobileFirst Adapter and:
- If selecting the "sendBroadcastNotification" procedure, provide the application ID and notification text in quotation marks.
- If selecting the "sendTagNotification" procedure, provide the application ID, notification text and tag name in quotation marks.
- The application ID can be determined from the
- If using the CLI: