All Products
Search
Document Center

Create a message - Simple push

Last Updated: Aug 18, 2021

Simple push is mainly used to push messages to a small number of targets. For example, you can use simple push to test the validity of Apple push certificates and the correctness of connection by the Android Push SDK. When creating a message, you can add the message content without using any template. You can push messages to specified users or devices.

Note:
  • Since manual operations are required, we recommend you push messages through the console in the scenarios requiring low-frequency message push, such as system verification, operation support, and temporary emergency requirement.
  • The messages are pushed immediately after they are created. You cannot delete or modify them.

The following sections describe how to create a simple push message in the console.

Prerequisites

  • To push messages to iOS devices, you should have integrated MPS iOS SDK (see Access iOS SDK) and configured the iOS push certificate on the Push configuration page in mPaaS console. For more information, see Configure iOS push certificate.
  • To push messages through the Android vendor channels (also known as third-party channels), you should have integrated MPS Android SDK (see Access Android SDK), accessed relevant vendor channels (see Access vendor push channels) and completed corresponding push channel setting on the Third-party channels page in mPaaS console. For more information, see Channel configuration.

Procedure

Log in to the mPaaS console, select the app, and perform the following steps to create a message:

  1. In the left-side navigation pane, choose Message Push Service to enter the Message list tab on the right side of the page.
  2. Click the Create a message button, and in the pop-up dialog box, select the Simple push tab.
  3. On the simple push tab page, configure the basic information of the message. The configuration items are as follows:

    Parameter Required Description
    Target ID type Yes Select a message sending mode. Options:
    • UserId: Enables you to push messages based on the user dimension. You need to call the bind API to bind the user ID and the device ID. For more information about the bind API, see API reference.
    • DeviceId: Enables you to push messages based on the device ID.
    Push platform Yes When you push messages based on the device ID, you need to select a push platform to specify the type of the target device. Options:
    • Android: The target device is an Android mobile phone.
      • When the Android message push channel is MPS self-built channel or you use Badge message (with the extension parameter badge configured), the self-built channel is used to push messages.
      • In other scenarios, when you access the three-party push platform (Xiaomi, Huawei, OPPO, vivo, and FCM) and the target device is the model of the corresponding vendor, use the three-party channel to push the message, otherwise, use the self-built channel to push the message.
    • iOS: The target device is an iPhone. Use the vendor channel to push the message.
    Customer message ID Yes Customer message ID is automatically generated by the system to uniquely identify the message in the client’s system. It can be customized and a maximum of 64 characters are allowed.
    Target ID Yes Enter the user ID and device ID.
    • You need to enter the correct ID based on the selected target ID type, otherwise it will lead to a push failure.
    • When the target ID type is DeviceId, the target ID is device ID (enter Ad-token for Android devices and Device Token for iOS devices). The corresponding mobile phone operating system should be consistent with the selected push platform, otherwise it will lead to a push failure.
    • If there is any space in the device ID obtained from sources such as logs, you need to delete the space.
    Android message channel Yes Only available for Android push platform. Options:
    • Default channel: MPS uses vendor channels to push messages. When your app is not connected to the vendor channel, or it is connected to the vendor channel but the target device is not manufactured by the third party, the system uses an MPS self-built channel to push messages.
    • MPS self-built channel: MPS uses a self-built channel to push messages.
    For Android devices, this parameter specifies whether to push messages through an MPS self-built channel or vendor channel. For iOS devices, you do not need to set this parameter (iOS push belongs to vendor channel push).
    Display type Yes Options:
    • Show message (on notification bar): Indicates that the message will be displayed in the notification bar.
    • Silent push: Indicates that the message will not be displayed in any form on the target device.
    For Android devices, you need to perform different operations according to the push channel that you have selected:
    • MPS self-built channel: This parameter is sent to the client as a reference field. You need to parse the message body and get the content of this field, then control the display of the message.
    • Vendor channel: This parameter is sent to the target device as a field. The device vendor’s system will then parse the content of this field, and control the display of the message. You do not need to perform any other operations.
    For iOS devices, the display of messages is controlled by the device vendor’s system. You do not need to perform any other operations.
    Display style Yes The style that how the message is displayed on the client. You can choose any one of the following three styles: Default (short text), Big text, and Rich text.
    • Default: This style is suitable for messages with concise and clear content. The message of this style contains title and text only. It is recommended to keep the length of the message text within 100 characters, including custom parameters and symbols.
    • Big text: This style is suitable for messages with long text, such as information and news messages, so users can quickly obtain information without opening the application. The message of this style contains title and text only. It is recommended to keep the length of the message text within 256 characters, including custom parameters and symbols.
    • Rich text: This style supports the messages containing icon and image, suitable for the messages with various content. To ensure good message presentation effect, it is better to keep the text within two lines.
    Message title Yes Enter the title of the message with no more than 200 characters. The message display effect can be previewed in the preview area.
    Message body Yes Enter the message boy with no more than 200 characters. The message display effect can be previewed in the preview area.
    Icon No The icon displayed on the right of the message, which can be JPG, JPEG or PNG image. Enter the public accessable URL of the icon here.
    If you only provide the default icon URL while no materials are uploaded for the corresponding vendor channels, the default icon will be automatically pulled and used for the messages pushed through the vendor channels. Since the vendor channels have different requirements on the icon material, it is suggested to upload the material for each vendor channel seperately according to their requirements.
    • Default icon: The suggested size is 140 * 140px, not exceeding 50 KB.
    • OPPO icon: The suggested size is 140 * 140px, not exceeding 50 KB.
    • Xiaomi icon: The suggested size is 120 * 120px, not exceeding 50 KB.
    • Huawei icon: The suggested size is 40 * 40dp, not exceeding 512 KB.
    • For FCM channel, if no specific requirement applies, the default icon will be automatically used.
    Large image No The image displayed at the lower part of the message, which can be JPG, JPEG or PNG image. Enter the public accessable URL of the image here.
    If you only provide the default image URL while no materials are uploaded for the corresponding vendor channels, the default large image will be automatically pulled and used for the messages pushed through the vendor channels. Since the vendor channels have different requirements on the image, it is suggested to upload the material for each vendor channel seperately according to their requirements.
    • Default image: The suggested size is 876 * 324px, not exceeding 1 MB.
    • OPPO image: The suggested size is 876 * 324px, not exceeding 1 MB.
    • Xiaomi image: The suggested size is 876 * 324px, not exceeding 1 MB.
    • iOS image: Support custom images, without limitation on image size.
    • For FCM channel, if no specific requirement applies, the default image will be automatically used.
    • For iOS channel, the material can be customized by you, and no system specification applies.
    Action upon click Yes Specify the operation to be performed after an user taps the message on the phone. This parameter is sent to the client as a reference field. You need to implement subsequent operations by referring to the field.
    Options:
    • Open Intent Activity: After a user taps the message, the system jumps to a native page.
    • Open Web URL: After a user taps the message, the system jumps to the specified webpage.

    The preview area is on the right side of the Create a message window. To preview the message display effects for different platforms respectively, click Notification, iOS message body and Android message body.

  4. (Optional) Configure the advanced information on demand. In the Advanced information area, complete the following configurations:

    • URL: The page to be visited after a user taps the message on the mobile phone. This parameter is sent to the client as a reference field (for your reference only) and does not take effect. You need to implement the redirection logic by yourself.
      Enter different content according to the value specified for Action upon click:
      • Open Intent Activity: Enter the URL of the native page to be visited (Android: ActivityName; iOS: VCName).
      • Open Web URL: Enter the URL of the web page to be visited.
    • Valid period: Specify the valid period of the message in seconds. It is 180 seconds by default. To ensure the message arrival rate, when a message fails to be sent because the device is offline or the user is logged out, MPS will resend it after the device is connected or a user binding request is initiated within the validity period of the message.
    • Extension parameters: Turn the switch on, click Add parameter, set the key/value, and left click on any area of the page to complete setting. The extension parameters are passed to the client together with the message body for your use.
      Extension parameters include the following three types:
      • System extension parameters
        These extension parameters are occupied by the system, and cannot be modified. System extension parameters include:
        • notifyType
        • action
        • silent
        • pushType
        • templateCode
        • channel
        • taskId
      • System extension parameters with some significance
        These extension parameters are occupied by the system and have some significance. You can configure values of these extension parameters.
        For more information about these parameters, see the following table.
        Parameter Description
        sound The custom ringtone of the message. The value of this parameter is the path of the ringtone. This parameter is only valid for Xiaomi phones and iPhones.
        badge Badge number. Its value is a specific number. This extension parameter will be passed to the client together with the message body.
        • For Android devices, you need to implement the badge logic by yourself.
        • For iOS devices, iOS system automatically implements the badge logic. When a message is pushed to the target mobile phone, the number that you specified in value appears in the badge of the app icon.
        mutable-content The APNs custom push identifier. If a pushed message carries this parameter, it indicates that the UNNotificationServiceExtension of iOS10 is supported, otherwise it is a normal push. Value is set to 1.
        badge_add_num Accumulative badge number, only available in Huawei channel.
        badge_class Activity class corresponding to the desktop app icon in Huawei channel.
        big_text Big text style, the value is fixed to 1, and other values are invalid. This parameter is only valid for Xiaomi and Huawei phones.
      • User-defined extension parameters
        All other parameters than system extension parameters and system extension parameters with some significance are user-defined extension parameters. User-defined extension parameters are passed to the client together with the message body for your use.
  5. Click Submit, and the message will be pushed to the target ID.

Relevant operations