{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":34912,"path":"mobile/mentions-config.md","title":"Configure push notifications for mobile activity stream mentions","bundle":null,"doc_type":null,"release":"australia","body":"\n# Configure push notifications for mobile activity stream mentions\n\nEnable users to alert their contacts, through the use push notifications, that they are mentioned in a thread. The user enters the `@` character followed by the contact's name in a record's activity stream, for their contact to be alerted.\n\n## Before you begin\n\nRole required: admin\n\n## Procedure\n\n1.  Create the push notification message content, which defines where you are pushing the notification to.\n\n    1.  Navigate to **System Notification** &gt; **Push** &gt; **Push Message Content** in the filter navigator.\n\n    2.  In the Push Notification Message Content form, select **New**.\n\n    3.  On the form, fill in the fields.\n\n<table id=\"table_lkl_pyb_znb\"><thead><tr><th>\n\n \n\n</th><th>\n\n \n\n</th></tr></thead><tbody><tr><td>\n\nName\n\n</td><td>\n\nName of your push message content record. This name is not visible to your users.\n\n</td></tr><tr><td>\n\nApplication\n\n</td><td>\n\nScoped application associated with this record. This field defaults to the current application.\n\n</td></tr><tr><td>\n\nPush app\n\n</td><td>\n\nMobile app that uses your push notification.-   Enter **ServiceNow Mobile Application** for the Mobile Agent app.\n-   Enter **ServiceNow Request Application** for the Now Mobile app.\n\n\n</td></tr></tbody>\n</table>    4.  In the **Push Message Generation** field, copy the following sample JSON code and paste it in the field.\n\n        ```\n        (function buildJSON(/*GlideRecord*/ current, /*String*/ message, /*Object*/ attributes) {\n        \n            var layoutFieldGenerator = new global.NotificationLayoutFieldGenerator();\n            var json = {};\n        \tvar deepLinkGenerator = new global.MobileDeepLinkGenerator(\"<client type>\");\n        \t\t\n            var link = deepLinkGenerator.getFormScreenLink('<form_screen_sys_id>', current.getValue(\"table\"), current.getValue(\"document\"));\n            json = {\n                \"aps\" : {\n                    \"sound\" : \"default\"\n                },\n                \"Link\": link\n            };\n            \n            return json;\n            \n        })(current, message, attributes);\n        ```\n\n        Customize the values in the code:\n\n        1.  Locate the sys\\_id of the record screen by right-clicking on the screen name and selecting **Copy sys\\_id**.\n        2.  Replace the `<form_screen_sys_id>` portion of the code with the sys\\_id.\n        3.  Define a client type in the variable `global.MobileDeepLinkGenerator` Possible values are:\n            -   agent\n            -   request\n            -   onboarding\n    5.  Select **Submit**.\n\n2.  Create a message for the user's contacts to receive when they are mentioned in a record's activity stream.\n\n    1.  Navigate to **System Notification** &gt; **Push** &gt; **Push Messages**.\n\n    2.  In the Push Notification Message form, select **New**.\n\n    3.  On the form, fill in the fields.\n\n<table id=\"table_qdf_51c_znb\"><thead><tr><th>\n\n \n\n</th><th>\n\n \n\n</th></tr></thead><tbody><tr><td>\n\nName\n\n</td><td>\n\nName of your push message content record. This name is not visible to your users.\n\n</td></tr><tr><td>\n\nApplication\n\n</td><td>\n\nScoped application associated with this record. This field defaults to the current application.\n\n</td></tr><tr><td>\n\nPush app\n\n</td><td>\n\nMobile app that uses your push notification.**Note:** Make sure to enter the same mobile app entered in the **Push app** field in the Push Notification Message Content form.\n\n</td></tr><tr><td>\n\nPush Message Content\n\n</td><td>\n\nSelect the push message content you created.\n\n</td></tr><tr><td>\n\nTable\n\n</td><td>\n\nTable containing the records relating to your notification. Select `live_notification`.\n\n</td></tr><tr><td>\n\nMessage\n\n</td><td>\n\nMessage that appears to the user's contacts, informing them they are mentioned.\n\n</td></tr></tbody>\n</table>    4.  Select **Submit**.\n\n3.  Create the push notification and define when to send it, who receives it, and what it contains.\n\n    1.  Navigate to **System Notification** &gt; **Push** &gt; **Push Notifications**.\n\n    2.  In the Push Notification view form, select **New**.\n\n    3.  On the form, fill in the fields.\n\n        |Field|Description|\n        |-----|-----------|\n        |Name|Name of your push notification. This name is not visible to your users.|\n        |Active|Option for determining whether the push notification is active. Select this option.|\n        |Table|Table containing the records relating to your notification. Select the same table as the push notification view form, `live_notification`.|\n        |Push Message Only|Option that determines whether to send a push notification to a mobile device. This field is automatically selected and is read-only by default.|\n        |Category|Category to which this notification belongs. A category identifies and groups related notifications. This category defines which actions are available in the push notification.|\n\n    4.  Select the **When to send** tab and then select **Inserted**.\n\n    5.  Select the **Who will receive** tab and then select the lock icon \\(\\[Omitted image \"lock-icon.png\"\\] Alt text: Lock icon.\\) in the **Users/Groups in fields**.\n\n    6.  Move **User** to the selected list.\n\n        **Note:** If the notification is addressed to a user with an inactive record in the User \\[sys\\_user\\] table, the notification is not sent.\n\n    7.  Select the **What to send** tab and select the lock icon \\(\\[Omitted image \"lock-icon.png\"\\] Alt text: Lock icon.\\) next to the **Push Messages** field.\n\n    8.  Select the reference lookup icon \\(\\[Omitted image \"reference-lookup-icon.png\"\\] Alt text: Reference lookup icon.\\) to open the Push Notification Messages page.\n\n    9.  Select the push notification message you created.\n\n        The push notification is listed as one of the available messages in the **What to send** tab.\n\n    10. Select **Submit**.\n\n4.  Enable your mobile app settings for notifications.\n\n    1.  Select the Settings icon \\(\\[Omitted image \"GearIcon.png\"\\] Alt text: Settings icon.\\) and select the **Notifications** tab.\n\n    2.  Verify that **Allow Notifications** is enabled.\n\n    3.  Verify that the mobile app you selected to receive notifications is enabled by noting the setting of either the **ServiceNow Mobile Application** or **ServiceNow Request application** field.\n\n\n**Parent Topic:**[Configure notifications for mobile activity stream mentions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/mobile/notification-activity-stream.md)\n\n"}}