Rich media push allows you to push rich media contents such as image, audio, and video in addition to text, which can effectively increase the notification click rate. You can use this feature to push a wider variety of contents such as news, coupons, and event information, satisfying your personalized push needs.
Currently, the rich media push feature of TPNS supports the following types of rich media contents:
Note:
The TPNS channel for iOS supports the rich media push feature by default. In the APNs channel, the application needs to integrate with the notification service extension plugin.
The supported types of rich media and use requirements for each push channel are as detailed below:
Push Channel | Supported Type | Use Requirements |
---|---|---|
Huawei | Thumbnail | 1. PNG/JPG/JPEG format2. 120 x120 px in dimensions. If this limit is exceeded, the image will be automatically adjusted. 3. Below 200 KB in size |
Mi | Big image | 1. PNG , JPG , or JPEG format 2. Fixed at 876x324 px in dimensions 3. Below 1 MB in size pic_url specified by Mi, and enter it in the corresponding TPNS push parameter xg_media_resources . For more information, please see the big image upload API description in Mi Push Rich Media Message |
TPNS | Big image + thumbnail + audio | Android platform: 1. JPEG/JPG/PNG format2. For a big image, its height cannot exceed 256 px, and the width is adaptive 3. For a thumbnail, its height or width cannot exceed 120 px, otherwise, it will be cropped in a center-aligned square 1. The audio file cannot exceed 5 MB in size iOS platform: refer to the requirements of the APNs channel |
APNs | Thumbnail + audio/video | 1. JPEG , PNG , or GIF format 2. Below 10 MB in size 1. MPEG , MPEG-2 Video , MPEG-4 , or AVI format 2. Below 5 MB in size |
Log in to the TPNS Console and select Push Management > Push Task on the left sidebar to enter the push task page.
Click Create Push > Advanced Settings.
Enable Notification Image or Notification Audio/Video and enter the rich media message URL. The specific configuration is as detailed below:
Note:
- Thumbnail:
The URL must be in HTTPS format.
The thumbnail can be displayed for pushes delivered through the TPNS and Huawei channels.
Format requirements: image inPNG
,JPG
, orJPEG
format at dimensions of 120×120 px and below 200 KB in size.- Big image:
The URL must be in HTTPS format.
The big image can be displayed for pushes delivered through the TPNS and Mi channels.
Format requirements: image inPNG
,JPG
, orJPEG
format at fixed dimensions of 876x324 px and below 1 MB in size.
iOS:
Note:
After the image URL is entered, the image will be displayed in the notification. Format requirements:
- The file size cannot exceed 10 MB.
- The file must be in
PNG
,JPG
,JPEG
, orGIF
format.- The URL must be in HTTPS format.
Note:
After the audio URL is entered, notifications delivered through the TPNS channel can contain audio.
- The audio file size cannot exceed 5 MB.
- The URL must be in HTTPS format.
iOS:
Note:
After the audio/video URL is entered, notifications can contain audio or video and be played back through Apple's native component.
- The audio/video file size cannot exceed 5 MB.
- The file must be in
MPEG
,MPEG-2 Video
,MPEG-4
, orAVI
format.- The URL must be in HTTPS format.
If you want to deliver rich media messages when calling the API for push, you can set the following parameters in the Android or iOS message body in the Push
API:
Platform | Parameter | Remarks |
---|---|---|
Android | icon_res , icon_type xg_media_resources xg_media_audio_resources |
|
iOS | xg_media_resources |
Notification image and notification audio/video cannot be enabled at the same time |
For more information, please see the description of required parameters for the Push API.
{
"audience_type": "token",
"token_list": [
"05da87c0ae******2dfa9e08d884aada5bb2"
],
"message_type": "notify",
"multi_pkg":true,
"message": {
"title": "Push title",
"content": "Push content",
"xg_media_resources": "xxx1" , // Enter the rich media element address, such as `https://www.xx.com/img/bd_logo1.png?qua=high`
"xg_media_audio_resources":"xxx", // Enter the audio rich media element address, such as `https://sc1.111ttt.cn/2018/1/03/13/396131227447.mp3`
"android": {
"icon_type": 1,
"icon_res": "xxx", // Enter the image thumbnail element address
"custom_content":"{\"key\":\"value\"}"
}
}
}
Notifications delivered through the TPNS, Huawei, Mi, and FCM channels can contain images, while those delivered through the Meizu, OPPO, and Vivo channels are in text format without images by default.
No matter whether you call an API or use the console to deliver a message, you should generate a URL for the image to include it in the message.
Audio rich media pushes delivered through the TPNS channel can display the audio normally, while those delivered through other channels will be in text format without audio by default.
No. Only one of them can be enabled at a time.
Was this page helpful?