The configuration and behavior of critical notifications differ between iOS and Android.
Critical notifications were introduced in iOS 12 and are designed for sending high-priority notifications that you don't want to miss - for example security system, water leak sensor, and smoke/CO2 alarm alerts.
iOS gives special priority to this type of notification. Critical alerts always appear at the top of your lock screen above all other notifications, and play a sound even if Do Not Disturb is enabled or the iPhone is muted. Because we never want you to miss a critical notification, they are allowed to bypass the app notification rate limits as well.
If you have previously read the sounds documentation this syntax should be mostly familiar. Note the example expands the
sound attribute to include the
critical: 1 flag, and
volume: 1.0 to set the volume to 100 %.
For CarPlay users, it's also worth mentioning that critical notifications are the only ones that can appear on the car's built-in display, making them very useful if you want to know when something critical happens while you're driving.
For Android, notifications will appear immediately in most cases. However, in some cases (such as phone being stationary or when screen has been turned off for prolonged period of time), default notifications will not ring the phone until screen is turned on.
To override that behavior, set
priority: high and
By default they also do not override Do Not Disturb settings, if you would like to override this you will need to use notification channels.
You can also force the notification to play from the alarm stream so it will make the device ring even if on vibrate/silent ringer mode. Users on Android 7 and below can still use the
channel example below as we are just using it to override the default notification behavior for sound. In order to make a notification show up immediately and make a sound regardless of ringer mode follow one of the examples below.
Using this method to can send a normal notification:
Or you can use Text To Speech to speak the notification:
Alternatively using Text To Speech you can also make the notification speak as loud as it can, and then revert back to the original volume level: