Broadcast notifications in native Windows 8 applications
OverviewBroadcast notification is similar to tag-based notification, except that a subscription to a reserved tag,
Push.ALL, is automatically created for every device. Broadcast notifications are thus notification messages that are targeted to all subscribed devices. Broadcast notification is enabled by default for any push-enabled MobileFirst application. You can disable this capability by unsubscribing the device from the reserved
For more information about broadcast notification, see the "broadcast notification" topic in the user documentation.
Common API methods for tag-based and broadcast notifications
WLNotificationListenerDefines the callback method to be notified when the notification arrives.
WLPush.notificationListener = new MyNotificationListener();Sets the implementation class of the
WLNotificationListeneris called when a push notification is received by the device.
- props - A JSON block that contains the notifications properties of the platform.
- payload - A JSON block that contains other data that is sent from MobileFirst Server. The JSON block also contains the tag name for tag-based or broadcast notification. The tag name appears in the "tag" element. For broadcast notification, the default tag name is
Server-side APIThis method submits a notification that is based on the specified target parameters.
- applicationId - (mandatory) The name of the MobileFirst application
- notificationOptions - (mandatory) A JSON block containing message properties
For a full list of message properties, see the
WL.Server.sendMessageAPI in the API reference of the user documentation.
Sample applicationBefore running the application, check the adapter's
PushAdapter-impl.jsfile and verify that the
WL.Server.sendMessage()method uses the correct application name. The correct application name can be determined from the
application-descriptor.xmlfile. Click to download the Studio project. Click to download the Native project. ▲
Last modified on November 29, 2015