Create a message - Batch push

更新时间:
复制 MD 格式

Important

mPaaS Message Push now uses a new console. The push methods in the Create Message Push Task window have been streamlined. The previous four methods (Simple Push, Template Push, Batch Push, and Broadcast Push) are now consolidated into two: Simple Push and Batch Push. The new Simple Push method includes the features of the original Simple Push and Template Push. The new Batch Push method includes the features of the original Batch Push and Broadcast Push.

Batch push is a method for sending messages to multiple targets. It is often used for operational needs.

Batch push has two types:

  • Broadcast push: Sends the same template message to all Android, iOS, or HarmonyOS devices for your application. This method only supports pushing messages by device. When you broadcast a message, it will be received by all devices that meet the following conditions within the message validity period: Android devices that establish a connection, and attached iOS or HarmonyOS devices.

  • Targeted push: Sends the same template message to a specific audience group. You can manually upload an audience file, define a custom audience, or directly use an audience group from Mobile Analysis.

Note
  • Because these operations are performed manually, the console is best used for pushing messages in low-frequency scenarios, such as system validation, operational support, and urgent, temporary needs.

  • After a message is created, it is pushed immediately. You cannot delete or modify it.

This topic describes how to create a batch push message in the console.

Prerequisites

  • Before you push messages to iOS devices, make sure you have integrated the Message Push iOS SDK. You must also configure the push certificate for Apple devices on the Channel Configuration page in the console. For more information, see Configure the iOS push channel.

  • Before you push messages to HarmonyOS devices, make sure you have integrated the Message Push HarmonyOS SDK. You must also configure the push certificate for HarmonyOS devices on the Channel Configuration page in the console. For more information, see Configure the HarmonyOS push channel.

  • Before you use an Android vendor channel to push messages, make sure you have integrated the Message Push Android SDK and the corresponding vendor channel. You must also complete the push channel configuration on the Channel Configuration page in the console. For more information, see Configure Android push channels.

  • Before you create a batch push message, you must create a template. For more information, see Create a template.

  • If you are creating a batch push message and want to target an audience group from Mobile Analysis, you must first create the audience group. For more information, see Create an audience group. If you want to target a user tag group, you must first create the user tag group. For more information, see Create user tags.

Procedure

  1. Log on to the mPaaS console and select the target application. In the left navigation pane, choose Message Push > Message Management.

  2. Click Create Message Push Task. In the dialog box that appears, select the Batch Push tab.

  3. On the Batch Push tab, configure the basic information for the push message. The configuration items are described as follows:

    Parameter

    Required

    Description

    Message type: Silent

    Yes

    Specifies whether to display the message:

    • Yes: The message is silent. The user is not aware of the message, and it is not displayed on the target device.

    • No: The message is displayed in the notification bar.

    For the Android platform, you must perform different follow-up operations based on the push channel:

    • Self-built channel: This parameter is sent to the client as a reference field. You must parse the message body and use this field to control how the message is displayed.

    • Vendor channel: This parameter is sent to the target device. The vendor's system parses the field and controls the message display. No other action is required.

    For the iOS and HarmonyOS platforms, the message display is handled by the vendor's system. No other action is required.

    Batch push method

    Yes

    Select the message delivery mode. Options include the following:

    • Push by user: Pushes messages based on user IDs. You must call the attach API to attach user IDs to device IDs. For more information about the attach API, see Client API.

    • Push by device: Pushes messages based on device IDs.

    Push platform

    Yes

    When you push messages by device, you must select a push platform to specify the device type.

    • Android: Provides Android vendor channels and the MPS self-built channel. Pushes messages to all online Android devices on the network (within the message validity period) or to specified Android devices. Each device receives the message only once.

    • iOS: Uses the vendor channel to push messages to all or specified iOS client users. Each user receives the message only once.

    • HarmonyOS: Uses the vendor channel to push messages to all or specified HarmonyOS client users. Each user receives the message only once.

    Push target

    Yes

    • When you push dimensions to a user, the following options are available:

      • Manual upload: Manually upload a file of target users. The file must contain the target IDs and personalized configurations for each target based on the selected template. Each line in the file represents one message, and each message is identified by a business message ID. The file format requirements are as follows:

        • Each line must be in the format: User ID,Business Message ID,placeholder1=XXX;placeholder2=XXX.... The business message ID is user-defined.

        • The file must be UTF-8 encoded. The maximum file size is 200 MB. Use line feeds to separate multiple data entries. Each entry cannot exceed 250 characters. You can upload a maximum of one file for each push task.

        After the file is uploaded, an icon for the uploaded file appears below the Manual upload button. Click the icon to preview the file content. You can preview up to 10 data entries.

      • Mobile Analysis audience: Uses an audience group from Mobile Analysis to send the same message to all members. You must first create a Mobile Analysis audience group. For more information, see Create an audience group. This option is not available if the selected push template contains placeholders.

      • User tag: Selects an audience group based on user tags. Before you select a tagged audience, you must first create user tags.

    • If you push by device, you can select:

      • All devices: Pushes the message to all devices on the selected platform.

      • Batch accounts: Manually upload a file of target devices. The file must contain the target IDs and personalized configurations for each target based on the selected template. Each line in the file represents one message, and each message is identified by a business message ID. The file format requirements are as follows:

        • Each line must be in the format: Device ID,Business Message ID,placeholder1=XXX,placeholder2=XXX.... The business message ID is user-defined.

        • The file must be UTF-8 encoded. The maximum file size is 200 MB. Use line feeds to separate multiple data entries. Each entry cannot exceed 250 characters. You can upload a maximum of one file for each push task.

          Example: mpaas_push_demo,123456,title=111,content=222.

        After the file is uploaded, an icon for the uploaded file appears below the Manual upload button. Click the icon to preview the file content. You can preview up to 10 data entries.

      • Mobile Analysis audience: Uses an audience group from Mobile Analysis to send the same message to all members. You must first create a Mobile Analysis audience group. For more information, see Create an audience group. This option is not available if the selected push template contains placeholders.

    Push template

    Yes

    Select a message template. You can choose any template from the Message Template page of the current application.

    Template placeholder

    Yes

    Enter the values for the variables in the template. The system provides configuration fields based on the placeholders in the selected template.

    Android message channel push priority

    Yes

    This applies only to the Android platform. Options include the following:

    • Prioritize vendor channel: Pushes messages through vendor channels first. For integrated vendor channels, the message is sent through the corresponding vendor channel service. For vendor channels that are not integrated, the message is sent through the MPS self-built channel.

    • MPS channel: Pushes messages through the MPS self-built channel.

    For the Android platform, this parameter lets you choose between the self-built channel and vendor channels. You do not need to configure this parameter for the iOS platform, because iOS pushes use the vendor channel.

    Push time

    Yes

    Select when to push the message:

    • Immediately: The message is pushed as soon as the push task is created.

    • Scheduled: Pushes the message at a specified time. For example, you can schedule a message to be pushed at 8:00 AM on June 19.

    • Recurring: Pushes the message repeatedly within a specified time range. For example, you can schedule a message to be pushed every Friday at 8:00 AM from June 1 to September 30.

    Important

    Scheduled and recurring pushes are not supported when the push target is a Mobile Analysis audience or a custom tag audience.

    On the right side of the dialog box is the Push Preview area. You can click Notification, Apple Message Body, Android Message Body, and HarmonyOS Message Body to preview the message display and the message body for each platform.

  4. (Optional) Configure the following advanced settings:

    • Action on click: Select the action that occurs when a user clicks the message. This parameter is sent to the client as a reference field. You must use this field to implement the subsequent action on the client.

      • Client-defined: After the message is clicked, the user is redirected to a native page.

      • Web page: After the message is clicked, the user is redirected to a web page.

    • Redirect URL: The URL of the page to open after a user clicks the message. Enter the page address based on your selection for Action on click:

      • If you selected Client-defined, enter the address of the native page to open (Android: ActivityName; iOS: VCName).

      • If you selected Web page, enter the URL of the web page to open.

    • Push by logon status: Refine the target audience based on user logon status. When you specify a logon or logoff period, selecting Permanent means the message is pushed to all logged-on or logged-off users without a time limit.

      Important

      You can configure the push by logon status only when you push by device.

      • If you select Logged-on users, the message is pushed to users who logged on to the app within the specified period. For example, if you set the logon period to 15 days, the message is pushed to users who logged on in the last 15 days.

      • If you select Logged-off users, the message is pushed to users who logged off from the app within the specified period. For example, if you set the logoff period to 15 days, the message is pushed to users who logged off in the last 15 days.

      • If you select both Logged-on users and Logged-off users, the message is pushed to users who logged on and logged off within the specified periods. For example, if you set the logon period to Permanent and the logoff period to 7 days, the message is pushed to all users who have ever logged on to the app and to users who logged off in the last 7 days.

    • Custom ID: The system automatically generates an ID to uniquely identify the message for your business logic. You can customize this ID with up to 64 characters.

    • Message validity period: The validity period of the message in seconds. If a message fails to be delivered because a device is offline or a user is logged off, MPS resends the message after the device connects or a user attach request is initiated within this period. This improves the message delivery rate. If you do not set this parameter, the default validity period is 180 seconds.

      Note

      The message validity period must be at least 180 seconds and no more than 72 hours.

    • Extended parameters: To add extended parameters, turn on the Extended parameters switch, click Add Parameter, and configure the key-value pair. Click anywhere on the page to complete the configuration. Extended parameters are sent with the message body to the client for custom processing. There are three types of extended parameters:

      • System extended parameters

        These parameters are reserved by the system, and their values cannot be modified. They include notifyType, action, silent, pushType, templateCode, channel, and taskId.

      • System extended parameters with special meanings

        These parameters are reserved by the system and have special meanings. You can configure the values for these parameters. The following table describes these parameters.

        Parameter

        Description

        sound

        A custom ringtone. Set the value to the path of the ringtone file. This parameter is effective only for Xiaomi and Apple phones.

        badge

        The badge number on the application icon. Set the value to a specific number. This parameter is sent with the message body to the client.

        • For Android phones, you must implement the logic for the badge.

        • For Apple phones, the system automatically handles the badge. After the message is pushed to the target phone, the application icon badge displays the configured value.

        mutable-content

        The APNs custom push identifier. Including this parameter indicates support for iOS10's UNNotificationServiceExtension. If this parameter is not included, it is a normal push. Set the value to 1.

        badge_add_num

        The number to add to the badge for pushes through the Huawei channel.

        badge_class

        The entry Activity class of the application corresponding to the desktop icon for the Huawei channel.

        big_text

        The big text style. The value must be 1. Other values are invalid. This parameter is effective only for Xiaomi and Huawei phones.

      • User-defined extended parameters

      Any parameter (key) that is not a system extended parameter or a system extended parameter with a special meaning is a user-defined extended parameter. User-defined extended parameters are sent with the message body to the client for custom processing.

  5. Click Submit. The created message appears in the batch message record list.

In addition to pushing messages from the console, you can also push messages by calling an API. For more information, see Server-side API reference.

Related operations