Push notification system

  • Release version: Xanadu
  • Updated August 1, 2024
  • 2 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of Push notification system

    The push notification system in ServiceNow manages the delivery and response handling of push messages for mobile applications, including the ServiceNow Classic mobile app and custom push applications. It enables real-time communication by sending notifications triggered by activity in your ServiceNow instance to users’ mobile devices, and supports interactive responses that can trigger automated actions back in the instance.

    Show full answer Show less

    Key Components

    • Customer instance: Your ServiceNow environment where notifications originate.
    • Push proxy: An intermediary instance that forwards notifications from the customer instance to Apple Push Notification service (APNs) or Firebase Cloud Messaging (FCM) for the ServiceNow Classic mobile app. Not used with custom push apps.
    • Push provider: External services (APNs for iOS, FCM for Android) that deliver notifications to mobile devices.
    • Push application on mobile device: The target app receiving notifications, either the ServiceNow Classic mobile app or a custom-built push application.

    Push Notification Process

    • An event in the instance triggers a notification.
    • The instance determines the recipients and checks their notification preferences and device settings.
    • The notification is sent to the push provider through the push proxy for the Classic app, or directly for custom push apps.
    • The push provider delivers the message to the user’s mobile push application.
    • Notifications include message content, instance name, and ID to ensure responses are routed correctly.
    • If users respond to the notification (e.g., approve a change request), their response is sent back to the instance via a REST message.
    • The instance runs a scripted action to process the response; errors in script execution result in error messages sent back to the device.

    Push Notification Responses with Custom Applications

    Custom push applications allow users to take actions directly from notifications. These actions are defined by scripts linked to the notification message and are sent back to the instance using a REST API call formatted as:

    https://{instancename}/api/now/v1/push/{applicationName}/action/{action}

    • applicationName: Must match the name in the Push Application [syspushapplication] table.
    • action: The Sys ID of the action script from the Push Notifications Actions [syspushnotifactscript] table.

    Practical Benefits for ServiceNow Customers

    • Enables timely, interactive communication with mobile users directly from their devices.
    • Supports custom workflows by allowing user responses to trigger scripted actions in your instance.
    • Improves user engagement and operational efficiency by integrating push notifications with instance processes.
    • Provides a structured, reliable mechanism for notification delivery and response handling across iOS and Android platforms.

    The push notification system involves several key elements that manage the delivery of push messages and push notification responses.

    Customer instance
    Your ServiceNow instance.
    Push proxy
    An instance that collects all push notifications that go to the ServiceNow Classic mobile application and forwards them to the ServiceNow applications for Apple iOS or Android. If you create a custom push application, you do not use the push proxy.
    Push provider
    The provider of push messages, which is the Apple Push Notification service (APNs) or Firebase Cloud Messaging (FCM) service, for the ServiceNow Classic mobile app or custom mobile apps.
    Push application on a mobile device
    The application, such as the ServiceNow Classic mobile application. You can also build and customize your own push application.

    Push notification process

    The push notification process is as follows:
    1. Activity on the instance triggers a push notification.
    2. The instance looks for who to send the notification to and checks the user notification preferences to find their push device settings.
    3. The instance sends the push notification to the push notification service, either the Apple Push Notification service (APNs) or Firebase Cloud Messaging (FCM) service. If you are using the ServiceNow Classic mobile app, the instance sends the notification through a push proxy instance, which then forwards the notification to the APNs or FCM service.
    4. The push notification service sends the notification to the user's push application. When the instance sends the notification to the push notification service, it includes message content along with the instance name and ID. This information ensures that a response to the notification is sent back to the correct instance. If the user can reply to the notification, such as sending an approval to a change request, the response is sent via REST message back to the instance.
    5. The instance identifies a script to run to handle the response.
    6. The script performs an action on the instance, such as marking a change request approved. If there is invalid JSON or if the script fails, an error response is sent back to the device.
    Figure 1. Push notification system with the ServiceNow Classic mobile app

    Push notification responses

    With custom push applications, you can have your users act on records in the instance by responding to a push notification.

    The actions that they can take are defined in a script that you associate with the notification message. The response is sent to the instance in this format:

    https://{instance_name}/api/now/v1/push/{application Name}/action/{action}
    The application name is the push application the user is using. The application name must match the application name in the Push Application [sys_push_application] table. The action is the Sys ID of the action in the Push Notifications Actions [sys_push_notif_act_script] table.