---
sourceDocument: Brazil Mobile Configuration and Navigation
sourceDocumentLink: https://www.servicenow.com/docs/r/mobile

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil Mobile Configuration and Navigation

ft:clusterId :

    - mobile

bundleId :

    - mobile

workflow :

    - Development, Data and Analytics


---

# Using JSON code

# Critical alerts from push notifications using JSON code {#ariaid-title1}

Release version: Brazil  
Updated September 10, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 3 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) 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 Critical alerts from push notifications using JSON code

This guidance explains how ServiceNow customers can configure push notifications as critical alerts using JSON code for iOS and Android devices.
Critical alerts override typical notification settings to ensure urgent messages are noticed, which is essential for ITSM and other critical communications.
Show full answer Show less  

## Key Features

* **Platform-specific JSON Code:** Different JSON structures are required to enable critical alerts on iOS and Android devices. Both must be included to support users with mixed device environments.
* **Android Activation:** Android critical alerts require a specific JSON entry that sets the notification priority to "high," enabling the device to wake and play the alert sound even under normal restrictions.
* **iOS and General Critical Alert JSON:** The JSON includes an "aps" dictionary with a "sound" object specifying the critical alert parameters:
  * **critical:** Set to 1 to activate the alert.
  * **name:** The critical alert tone filename (e.g., "NotificationAlert-1.caf").
  * **volume:** Alert volume, ranging from 0.1 (quiet) to 1.0 (loudest).
* **Sound Customization:** Several predefined tones are supported for critical alerts. If no name is specified, the system defaults to the app or device ringtone.
* **ITSM Script Include:** For ITSM customers, the existing script include `CriticalPushPayloadBuilder` automates critical alert JSON construction. No additional configuration is needed unless volume, tone, or alert status changes are required.

## Important Considerations

* **Device Behavior on Android:** Certain devices, such as OnePlus and Oppo, have hardware or Do Not Disturb (DND) behaviors that may affect critical alert sounds---e.g., physical ringer switches or temporary DND overrides during alert playback.
* **Limitations:** Critical alerts do not function on Android Private Space (Android 15+) or on Android devices managed by Mobile Device Management (MDM) solutions like Microsoft Intune.
* **Script Include Impact:** Modifying the ITSM script include parameters affects all ITSM implementations and may be overwritten by future plugin upgrades. Changes should be managed carefully.

## Practical Application for ServiceNow Customers

To enable critical push notifications, add the provided JSON snippets to the push message content area, ensuring both iOS and Android JSON are included. For ITSM users, utilize or customize the `CriticalPushPayloadBuilder` script include to maintain consistent behavior. This setup ensures critical alerts are delivered with high priority and audible notification, improving incident response and urgent communication effectiveness.  
You can make a push notification into a critical alert with the addition of some JSON code. Different JSON code is used for iOS and Android operating systems and for the ITSM business unit.
Critical alert notifications require two code elements: the push notification message structure and the JSON code that defines the notification as a critical alert. Add this code in the Push message content area. For more information, see [Create mobile critical alerts](https://www.servicenow.com/docs/wq2K7bmvCeoCfRlPH4wnGw "Create a critical alert from an existing push notification.").  
Important:  
On the Android platform, when a user receives a critical alert on certain phone types, they may experience the following device behavior:

OnePlus devices with hardware-controlled ringer mode:
:   On devices like OnePlus where the ringer mode is controlled by a physical switch, the app might not be able to override the notification sound volume if the device is set to silent or vibrate mode.

OnePlus or Oppo device Do Not Disturb mode behavior:
: On certain devices, like Oppo and OnePlus, if Do Not Disturb (DND) mode is enabled, the DND setting might be temporarily turned off until the critical notification sound has finished playing.  
On Android clients, version 20.0.0 and later, critical alerts don't work on the following:

* The Android Private Space feature that was introduced in Android 15.
* Android devices that are managed by Mobile Device Management (MDM) software. For example, Microsoft Intune.
{#mobile-citical-alert-code__ul_njx_jxl_tfc}

## Critical alert JSON to activate Android operating systems {#mobile-citical-alert-code__section_j43_xsj_d1c}

The following code must be added to the JSON code because it activates Android devices to wake up so that a critical alert can be triggered.  
Note:  
Because users use both iOS and Android devices you must add this code. The JSON entry in the code is a returned dictionary name value from the scripting.  

     

    json["sncGoogleKeys"] = { 
              "android": { 
                  "priority": "high" 
              }, 
              "priority": "high" 
          }; 

## Critical alert JSON for all operating systems {#mobile-citical-alert-code__section_y2l_qtj_d1c}

The following JSON must be added so that a notification behaves as a critical alert.  

    var json = {};
    json["aps"] = { 
    "sound": {
              "critical": 1, 
              "name": "NotificationAlert-1.caf", 
              "volume": 1.0 
    }
          };

The parameters in the sample JSON code are as follows:

* The critical parameter defines the notification as a critical alert. `1` means the critical alert is active, `0` means the critical alert is inactive.
* The name parameter is the name of the tone that is activated when a critical alert is sent. Some tones for critical alerts are listed in the table. For a complete list, see [Configure sounds for push notifications](https://www.servicenow.com/docs/9tKv63WENv~ly8BrLboohA "Add sounds and tones to push notifications to indicate to users if a message is urgent or just requires the users' attention.").{#mobile-citical-alert-code__table_s2l_z5j_d1c__entry__2}

  | Accepted file name values | Tone rhythm |
  |-|-|
  | `NotificationAlert-2.caf` | Dramatic |
  | `NotificationAlert-2-Short.caf` | Dramatic |
  | `NotificationAlert-9.caf` | Dramatic, Powerful |
  | `NotificationAlert-9-Short.caf` | Dramatic, Powerful |
  | `NotificationAlert-10.caf` | Dramatic, Suspenseful |
  | `NotificationAlert-10-Short.caf` | Dramatic, Suspenseful |
  [ ]

  {#mobile-citical-alert-code__table_s2l_z5j_d1c}  
  Note:  
  If a name value isn't defined, the system uses the application's default ringtone. If an application doesn't have a defined ringtone, then the system uses the device's default ringtone.
* The volume parameter defines the volume of the critical alert sound. The range is from `0.1` as the quietest to `1.0` as the loudest.
{#mobile-citical-alert-code__ul_zpp_ztj_d1c}

## Example JSON code block for critical alert {#mobile-citical-alert-code__section_lhj_tvj_d1c}

The following is a complete example block of JSON code that you must add and configure to activate a critical alert for Android and iOS devices.  

    json["sncGoogleKeys"] = { 
              "android": { 
                  "priority": "high" 
              }, 
              "priority": "high" 
          }; 
      
    json["aps"]["sound"] = { 
              "critical": 1, 
              "name": "NotificationAlert-1.caf", 
              "volume": 1.0 
          };

## IT Service Management (ITSM) CriticalPushPayloader script include {#mobile-citical-alert-code__section_y1p_lwj_d1c}

The Push message content area may contain previously configured code including the script include `CriticalPushPayLoadBuilder`, created by the ITSM business unit. If so, then no additional configuration is required for critical alerts. Script includes  are reusable server-side script logic that define a function or class.  `CriticalPushPayLoadBuilder` is a script include that contains functions to support critical alerts. The call of the script includes looks like this: `CriticalPushPayloadBuilder (current, json,
attributes).buildJSON()`  
Note:  
If you're required change the values of the `Volume` or `Name` parameters, or change the alert from critical to non-critical, you must access the function parameters that the script include is getting as inputs.

Changing the value of the critical alert script include affects all ITSM implementations of the script include. Similarly, an ITSM plugin upgrade could override your changes to your script include.

