-
Notifications
You must be signed in to change notification settings - Fork 19
Rich Push Notifications
- What are rich notifications?
- How to send Rich Notifications?
- How to implement the rich notifications feature?
- The JSON format for rich notifications
- Restrictions and limitations
- Images
Rich notifications enable you to send images within push messages. It is also possible to have a Title and a Body element of your message.
Please consult the Mobile Engage documentation
When using the Emarsys SDK with Android, there is no additional modification needed to use rich notifications.
By default, on Lollipop and earlier versions, if the title is missing, the SDK inserts the name of the application into the title. From Marshmellow version onwards, the name of the application is already displayed by default, so nothing is inserted in the title.
If customers do not want the application name as title, they can provide a title in the ems_default_title
custom data field.
The payload has the following format:
{
"title":"Game Request",
"body":"Bob wants to play poker",
"image_url":"https://www.xxx.jpg" //if_we_want_an_image
}
Note
The image url must be https.
The service has some limitations in its usage.
Mode | Type | |
Text | Image | |
Notification panel collapsed | Title is one line and it is truncated if too long. Body is one line and it is truncated if too long. Title and body length varies between 20 and 55 characters, based on screen density. |
The small image preview is shown center-cropped. Title is one line and it is truncated if too long. Body is one line and it is truncated if too long. Title length varies between 20 and 55 characters, based on screen density. Title and body length varies between 20 and 55 characters, based on screen density. |
Notification panel expanded | Title length varies between 20 and 80 characters, based on screen density. Body length varies between 200 and 460 characters, based on screen density. |
The image is shown in larger. The preview image disappears. Title is one line and it is truncated if too long. Body is one line and it is truncated if too long. Title length varies between 20 and 80 characters, based on screen density. Body length varies between 20 and 90 characters, based on screen density. |
Lockscreen | Expanded notifications are available from API level 16. Title length varies between 20 and 55 characters, based on screen density. Body length varies between 200 and 700 characters, based on screen density. | |
Heads up | Heads-up notifications are not supported. |
Note
The notification will crop text if longer, no scrolling.
Keep images between 800 and 1,038 px wide.
Always use landscape orientation, as rich push notifications on Android are cropped to something close to 16:9 (the exact ratio changes depending on the device).