Rich Media Notification

Last updated: 2020-12-01 11:47:20

    Operation Scenarios

    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.

    Scope of Application

    Currently, the rich media push feature of TPNS supports the following types of rich media contents:

    • Android: image and audio.
    • iOS: image, audio and video

      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
  • Only HTTPS URLs are supported
  • Format requirements:
    1. PNG/JPG/JPEG format
    2. 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
  • Only HTTPS URLs are supported
  • Format requirements:
    1. PNG, JPG, or JPEG format
    2. Fixed at 876x324 px in dimensions
    3. Below 1 MB in size
  • Note: to use the big image notification feature of the Mi channel, you need to first call the image upload API of Mi to upload the image file, get the image address 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:
  • Only HTTPS URLs are supported
  • Image format requirements:
    1. JPEG/JPG/PNG format
    2. 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
  • Audio/Video file format requirements:
    1. The audio file cannot exceed 5 MB in size
    iOS platform: refer to the requirements of the APNs channel
  • APNs Thumbnail + audio/video
  • Only HTTPS URLs are supported
  • Image format requirements:
    1. JPEG, PNG, or GIF format
    2. Below 10 MB in size
  • Audio/Video file format requirements:
    1. MPEG, MPEG-2 Video, MPEG-4, or AVI format
    2. Below 5 MB in size
  • Note: image and audio/video in notification cannot be enabled at the same time
  • Directions

    Console

    1. Log in to the TPNS Console and select Push Management > Push Task on the left sidebar to enter the push task page.

    2. Click Create Push > Advanced Settings.

    3. Enable Notification Image or Notification Audio/Video and enter the rich media message URL. The specific configuration is as detailed below:

      • If **Notification Image is enabled:**
        Android:

        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 in PNG, JPG, or JPEG 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 in PNG, JPG, or JPEG 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, or GIF format.
      • The URL must be in HTTPS format.

      • If **Notification Audio or Notification Audio/Video is enabled:**
        Android:

        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, or AVI format.
    • The URL must be in HTTPS format.

    RESTful API

    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
  • Thumbnail: icon_res, icon_type
  • Big image: xg_media_resources
  • Audio: xg_media_audio_resources
  • Thumbnail is supported only for the TPNS and Huawei channels
  • Big image is supported only for the TPNS and Mi channels
  • Audio is supported only for the TPNS channel
  • iOS
  • Image and audio/video: 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.

    Sample push on Android

    {
        "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\"}"
            }                        
        }
    }

    FAQs

    The Meizu, OPPO, and Vivo channels do not support rich media. How do I deliver a notification when pushing to all devices?

    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.

    How can I include an image in a push message?

    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.

    What is the delivery policy for audio rich media on Android?

    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.

    Can notification image and notification audio/video be enabled for rich media notification on iOS at the same time?

    No. Only one of them can be enabled at a time.

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help