All Products
Search
Document Center

Create a message - Simple push

Last Updated: May 07, 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 Android 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 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 configure the iOS push certificate on the Push configuration page in advance. For more information, see Configure iOS push certificate.
  • To use the third-party channels, you should configure the push channels on the Channel configuration page in advance. 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 third-party 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 third-party channels to push messages. When your App is not connected to the third-party channel, or it is connected to the third-party 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 third-party channel. For iOS devices, you do not need to set this parameter (iOS push belongs to third-party 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.
    • Third-party 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.
    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.
    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.

    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