Notifications Spec
How to add CM notifications to your app
Last updated
Was this helpful?
How to add CM notifications to your app
Last updated
Was this helpful?
Notifications are defined in your .
Here's an example notification config section. It creates one notification to remind users to complete the app's onboarding.
Content: deliver a message reminding the user to complete setup, with a CTA
Schedule: this notification will appear 10 minutes after the user dismisses the app.
Cancelation: the notificaiton will be canceled when the user completes setup
Timezone: it will be delivered between 9am and 9pm in the user's local timezone.
title [optional, string]: the title shown on the notification. If omitted and a body is included, the app's name will be used as the title.
body [optional, string]: a string for the text content shown in the notification
sound [optional, string]: the sound to play when the notification is delivered. Values are:
omitted: no sound is played
“default”: system default notification sound
We offer powerful config options to schedule when your users recieve notificaitons.
deliveryTime [required, object]: specifies when this notification should be delivered. There are two timing options, and exactly one of these must be provided on each notification.deliveryTime object:
Relative to an event: the notification is delivered after an event. This is set by deliveryTime.eventName, with optional additional properties listed below.
deliveryTime.eventOffsetSeconds [optional, int]: the delay between the event specified in eventName and the notificaiton delivery, in seconds.
deliveryTime.eventInstance [optional, string]: Behaviours are:
"latest-once" [default]: will deliver after the latest instance of the event. Once delivered, will not be deliver again. Without an eventOffsetSeconds, this is funtionally the same as "first".
"latest" will deliver after the latest instance of the event. This may deliver several times if the event reoccurs.
"first": delivers notification once after the first instance of eventName in your app, and only the first.
deliveryDaysOfWeek [optional, array of strings]: defaults to 7 days a week. This array specifies the days of week where this notification should be delivered in user-local timezone (example: ["Saturday","Sunday"]
). If the deliveryTime is not on one of these days, it will be pushed back to the first allowed day.
deliveryTimeOfDayStart/deliveryTimeOfDayEnd [optional, string]: the start and end time defining when to deliver the notificaiton, in "HH:MM" format, in the user local timezone. For example, start="09:00" and end="21:00" would deliver the notification between 9am and 9pm. If the deliveryTime is not in this range, it will be pushed back to the next time in the range.
Note: this condition is checked at schedule time, not delivery time. The condition may no longer be true when the notification is delivered. It's helpful to check things unlikley to change (completed_setup, app_version > x), but less helpful for things that change often (has_wifi, device_battery_level).
These properties are only needed for more advanced notifications, and can typically be omitted.
relevanceScore [optional, float]: The score the system uses to determine if the notification is the summary’s featured notification (from 0 to 1).
You can easily use your own notifications, such as push, along side Critical Moments. Our notification delegate will only handle notifications originating from Critical Moments, and will pass through any others to the notification delegete you set.
A top level notifications
object in your contains a set of named notification maps/objects. Each notification object has the following properties:
actionName [optional, string]: the name of the to launch when the user taps this notification. If not set, it will launch the app without performing an action.
Custom string: a named custom sound embedded in your app binary; see .
badgeCount [optional, int]: sets the (count). Set 0 to clear the badge. Badge updates can be scheduled in tandem with notification alerts, or simply omit the title/body to schedule a badge update without a notification alert.
idealDeliveryConditions: see our spec on for details
Exact timestamp, is specified with deliveryTime.TimestampEpoch
- an int in seconds.
deliveryTime.eventName [optional, string]: the to fire this notification after.
cancelationEvents [optional, array of strings]: if any of the listed here are fired, this notification will be canceled, and will never again be scheduled.
scheduleCondition [optional, string]: a Critical Moments , which is checked before the notification is scheduled. The notificaiton is not scheduled unless this condition returns true.
launchImageName [optional, string]: The name of the image or storyboard to use when your app launches. .
interruptionLevel [optional, string]: one of "active", "critical", "passive", "timeSensitive". See for details. "timeSensitive" requires you to set the "Time Sensitive Notification" capability on your app, and "critical" require approval from Apple.