Push notification system
Summarize
Summary of Push notification system
The push notification system in ServiceNow enables real-time delivery of push messages and responses to mobile devices. It involves coordination between your ServiceNow customer instance, a push proxy for the ServiceNow Classic mobile app, push providers such as Apple Push Notification service (APNs) or Firebase Cloud Messaging (FCM), and the push application on the user's mobile device.
Show less
Push Notification Components and Flow
- Customer Instance: Your ServiceNow environment where notifications originate.
- Push Proxy: Used only for the ServiceNow Classic mobile app; it collects and forwards push notifications to APNs or FCM.
- Push Provider: APNs or FCM services that deliver notifications to mobile devices.
- Push Application: The mobile app receiving notifications, either the ServiceNow Classic app or a custom-developed push app.
The notification process begins when activity on the instance triggers a push notification. The system identifies recipients, checks user notification preferences, and sends the notification to the push provider—directly or via the push proxy for the Classic app. Notifications include message content plus instance name and ID, ensuring responses return to the correct instance.
Push Notification Responses
For custom push applications, users can respond to notifications with actions defined by scripts linked to the notification message. Responses are sent back to the instance via a REST API endpoint structured as:
https://{instancename}/api/now/v1/push/{applicationName}/action/{action}
- applicationName: Must match the entry in the Push Application [syspushapplication] table.
- action: The Sys ID of the action from the Push Notifications Actions [syspushnotifactscript] table.
The instance executes the associated script to perform operations such as approving change requests. If errors occur due to invalid JSON or script failure, an error response is sent back to the device.
Practical Considerations for ServiceNow Customers
- Use the push proxy only if you rely on the ServiceNow Classic mobile app; custom apps communicate directly with APNs or FCM.
- Ensure user notification preferences and device settings are configured correctly to receive notifications.
- Define clear scripts for notification responses to enable interactive actions from mobile devices.
- Monitor and handle errors in push response scripts to maintain reliable communication.
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
- Activity on the instance triggers a push notification.
- The instance looks for who to send the notification to and checks the user notification preferences to find their push device settings.
- 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.
- 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.
- The instance identifies a script to run to handle the response.
- 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.
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.