This action is used in a solution on a PN-receiving mobile device for registering that device to receive PNs about one or more selected topics. For example, if a device is registered to receive PNs about topics marked as news and topics marked as travel, then it will receive any PN that is marked as either news or travel. A PN is marked with a topic when it is sent (see Send Push Notification). For example, if a PN is sent to the topics news and travel, it will be received by any device that is registered for either (or both) of these topics.
Note that it is the device that is registered for topics, so the action can be triggered from any solution on that device. It would, however, be logical and more intuitive to use the PN-receiving solution to register the PN topic.
Among different ways to define a set of PN receivers when sending a PN, you can specify that the PN be sent to one or more specific topics (see Send Push Notification). If a device is registered for any one of these topics, then the device will receive that PN.
|Note:||PN topics are supported on Android and iOS; they are not supported on Windows.|
See also: The Receiving Solution
To register an external PN topic, select Register, and specify a topic via an XPath expression. The expression must resolve to a string (for example: 'news') or a sequence of strings (for example: ('news', 'travel')). In the screenshot below, for example, Register/Unregister PN Topics actions are defined for a check box which is linked to a page source node. As a result of this linkage, the page source node will have a value of true (when the check box is checked) or false (when it is unchecked). Depending on whether the user checks the box or not, the device will be registered for the news topic or not (see screenshot) and accordingly will receive or will not receive PNs that are sent to the news topic.
If at some point the user wishes to not receive PNs that are sent to a topic for which the device is registered, then the Unregister action can be used to cancel the registration. This could be done, for example, on a button tap.
To unregister a PN, add the action, select Unregister, and enter the topic for which the device is to be unregistered. To unregister multiple topics, enter the topics as a sequence of strings (for example: ('news', 'travel')).
MobileTogether provides a range of XPath extension functions that have been specifically created for use in MobileTogether designs. Some functions can be particularly useful with specific actions. For example, mt-available-languages() returns the languages in which the solution is available and could, for example, be used with the Message Box action. If a function is especially relevant to this action, it is listed below. For a full list of extension functions and their descriptions, see the topic MobileTogether Extension Functions.