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, Tencent Push Notification Service rich media push supports the following types of rich media contents:
Note:The Tencent Push Notification Service channel for iOS supports rich media push by default. For the APNs channel, applications need to integrate with the notification service extension plugin.
The supported types of rich media and use requirements for each push channel are as follows:
Push Channel | Supported Type | Use Requirements |
---|---|---|
Huawei | Thumbnail |
|
Mi | Large image |
pic_url specified by Mi, and enter it in the corresponding Tencent Push Notification Service push parameter xg_media_resources . For more information, see the large image upload API description in here. |
Tencent Push Notification Service | Large image, thumbnail, and audio |
|
APNs | Thumbnail and audio/video |
|
Note:
- Thumbnail:
The URL must be in HTTPS format.
The thumbnail can be displayed in pushes delivered through the Tencent Push Notification Service and Huawei channels.
Format requirements:PNG
,JPG
, orJPEG
; 120 × 120 px; less than 200 KB- Large image:
The URL must be in HTTPS format.
The large image can be displayed in pushes delivered through the Tencent Push Notification Service and Mi channels.
Format requirements:PNG
,JPG
, orJPEG
; 876 x 324 px; less than 1 MB
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 Tencent Push Notification Service channel can contain audio.
- The audio file size cannot exceed 5 MB.
- The URL must be in HTTPS format.
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.
To send a rich media message via an API call, you can set the following parameters in the Android or iOS message body in the Push
API:
Platform | Parameter | Notes |
---|---|---|
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, see the Required Parameters section in 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 URL of the rich media element, such as `https://www.xx.com/img/bd_logo1.png?qua=high`.
"xg_media_audio_resources":"xxx", // Enter the URL of the audio, such as `https://sc1.111ttt.cn/2018/1/03/13/396131227447.mp3`.
"android": {
"icon_type": 1,
"icon_res": "xxx", // Enter the URL of the thumbnail.
"custom_content":"{\"key\":\"value\"}"
}
}
}
Notifications delivered through the Tencent Push Notification Service, Huawei, Mi, and FCM channels contain images, while those delivered through the Meizu, OPPO, and vivo channels are in plain text format without images by default.
Whether you call an API or use the console to deliver a message, you need to generate a URL for the image to include it in the message.
Audio pushes delivered through the Tencent Push Notification Service channel can display the audios normally, while those delivered through other channels will be in plain text format without audios by default.
No. You can only enable either of them.
Was this page helpful?