push live activities, mobile push, huawei live window, ios dynamic island, harmonyos live window

更新时间:
复制 MD 格式

This topic describes how to push live activities using the console.

Access the page

  1. Log on to the EMAS Management Console. Select the Mobile Push product.

  2. On the Mobile Push product page, select Create Task > Push Live Activities from the navigation pane on the left. This opens the Push Live Activities page.

Parameters vary by target platform. Parameter descriptions follow:

Android

Huawei Live Window

1. Basic configurations

Parameter

Description

Push target

Options include the following:

  1. All: Push to all devices.

  2. Specified devices: Push by device ID.

  3. Specified accounts: Push by account bound to the device ID.

  4. Specified aliases: Push by alias bound to the device ID.

  5. Device tags: Push by tag bound to the device ID.

Note
  1. When the target is specified devices, accounts, or aliases, upload device IDs, accounts, or aliases as a file.

  2. Upload a UTF-8 encoded TXT file, up to 30 MB, with one data record per line.

  3. Full push frequency limit: For the same AppKey and operating system, the interval between two full pushes must be at least 1 second. Additionally, within 10 consecutive minutes, you can push a maximum of 10 notifications (messages converted to notifications are treated as notifications) and a maximum of 30 messages.

Push time

Set the send time for this push.

Options include the following:

• Send immediately

• Scheduled send: Cannot exceed 7 days.

Non-basic configurations fully comply with Huawei Live Window’s official specifications. All parameters pass through to Huawei without modification or encapsulation. For complete configuration options and the latest features, see Huawei Live Window Notifications.

2. Live Window configurations

Parameter

Description

Live Window notification operation type

Specify the operation type for Live Window notifications. Options include the following:

  • Update: Update Live Window notification content.

  • End: Terminate Live Window notifications.

Live Window ID

The unique Live Window ID, generated by the developer, corresponds to activityId in the client's notificationManager.notify(activityId, notification).

Important

If the Live Window notification corresponding to the sent activityId does not exist, sending Live Window notifications with that activityId is restricted for 24 hours.

Business scenario

For business scenario values and usage limits, see the `event` in Huawei Live Window Push Guide.

Vendor channel notification type

Vendor channel notification types include the following:

  • Official notification (default)

  • Test notification

Fallback notification title

Content displayed in the notification bar when the system does not support Live Window notifications.

Fallback notification content

Content displayed in the notification bar when the system does not support Live Window notifications.

Silent notification

Indicate whether message updates require an alert.

  • Silent alert (default)

  • Ring and vibrate alert

Live Window version number

The version number for updating Live Window notifications (default is 0). It must be greater than or equal to 0. The new Live Window notification version number must be greater than the current Live Window notification version number; otherwise, the refresh fails.

3. Message notification configurations

Configure Live Window message notification layout data in this section. For corresponding fields, see the NotificationData struct. Required parameters vary by layout type.

Parameter

Description

Layout type

Options include the following:

  • Basic template type: Suitable for basic scenarios such as calls, download progress, audio recording, and screen recording.

  • Progress visualization type: Suitable for activities involving progress node display, such as food delivery, fresh produce delivery, and ride-hailing progress.

  • Emphasized text template type: Suitable for activities displaying key information such as meal pickup codes, parcel pickup codes, and license plate numbers.

  • Left-right text template: Suitable for activities involving start and end points, such as high-speed rail, train, and flight information.

  • Event type: Suitable for sports event scores, game event scores, and similar scenarios.

Common parameters:

Parameter

Description

Archive period

The Live Window notification archive period. This is the duration the notification remains in the notification center after the Live Window notification ends. The default is 0 (no retention), with a maximum of 1 hour, in seconds (s).

Notification title

The notification title, with a maximum length of 1024 characters.

Notification content

The notification content, with a maximum length of 1024 characters. The application can set the color of some text within the string, but only one color is allowed.

Display line separator

Control whether to display the line separator in the extended area.

Auxiliary area display type

For auxiliary area styles, see the Extend struct.

Note

  • When updating to a new layout type, reset this parameter.

  • When refreshing Live Window notification content, if the auxiliary area display type is an image and the image path is incorrect, the content refresh fails.

Click behavior type

For click behavior in the auxiliary area, see the definition of the ClickAction struct.

Custom data

Custom message payload, passed to the application on click, in key-value format.

Example: {"name": "john", age: 10}.

Basic template-specific parameters:

Parameter

Description

Large image icon

Local resource path, with a length limit of 1–255 characters. If not provided, the system uses the last refreshed image. Convert SVG resources to VectorDrawable and place them in the drawable directory.

Example: If the icon file icon.png is in /res/raw/, the value is /res/raw/icon.

Overlay application icon

Whether to overlay the application icon when a large image icon exists.

Maximum progress value

The maximum progress value, which must be greater than 0.

Current progress value

The current progress value, which must be greater than or equal to 0 and less than or equal to the maximum progress value.

Infinite loop

Whether it is an infinite loop style:

  • Enabled: Progress displays as a percentage (default).

  • Disabled: Progress displays as a numerical ratio.

Progress visualization type:

Parameter

Description

Progress percentage

Progress value from 0-100, which determines the indicator's position on the progress bar.

Indicator icon

The indicator icon for the progress bar chart is a local resource. If this icon fails to load, the system displays the version from the last refresh.

Example: If the icon file “icon.png” is in the application's “/res/raw” path, the value is “/res/raw/icon”.

Progress color

The color of the progress points and node icons to the left of the progress indicator, in "#ARGB" hexadecimal format. The default is blue.

Background color

The color of the progress points and node icons to the right of the progress indicator, in "#ARGB" hexadecimal format. The default is gray.

Node icons

Icons for each node on the progress bar. The array length ranges from [2,5]. These are local resources, separated by commas if multiple. Required during creation. For details, see nodeIcons in NotificationData.

Progress display type

Extended area progress display types:

  • Dashed line progress (default)

  • Normal solid line progress

  • Thick solid line progress

Indicator display type

Extended area indicator small icon display types:

  • Do not display indicator small icon (default).

  • Display above the progress line.

  • Display overlaid on the progress line.

Emphasized text template-specific parameters:

Parameter

Description

First line text

First line text, up to 128 characters.

Second line text

Second line text content, up to 128 characters.

Underline color

Specifies the underline color for the text in the #ARGB hexadecimal format. If you do not specify a color, no underline is displayed.

Description image

The description image for the extended area. It does not display by default. If a value is passed, it displays in the extended area on the right side of the notification. If no value is passed, the last image is used. For details, see the descPic field in NotificationData.

Left-right text template-specific parameters:

  • Left text block

    Parameter

    Description

    First line text

    First line text, up to 128 characters.

    Second line text

    Second line text content, up to 128 characters.

  • Left text block

    Parameter

    Description

    First line text

    First line text, up to 128 characters.

    Second line text

    Second line text content, up to 128 characters.

    Separator icon

    Local resource, occupies the center of the extended area.

Event type-specific parameters:

  • Home team

    Parameter

    Description

    Home team icon

    Team icon for the display area. For SVG resources, convert them to VectorDrawable resources and place the converted resources in the drawable directory.

    Example: If the icon file “icon.png” is in the application's “/res/raw” path, the value is “/res/raw/icon”.

    Home team name

    The team name.

    Home team score

    The event score.

  • Away team

    Parameter

    Description

    Away team icon

    Team icon for the display area. For SVG resources, convert them to VectorDrawable resources and place the converted resources in the drawable directory.

    Example: If the icon file “icon.png” is in the application's “/res/raw” path, the value is “/res/raw/icon”.

    Away team name

    The team name.

    Away team score

    The event score.

  • Match information

    Parameter

    Description

    Match description

    Description text above the center of the extended area.

    Match time

    Match time below the center of the extended area.

4. Capsule layout

In this section, enable the capsule layout using a toggle button and configure capsule notification layout data. For corresponding fields, see the CapsuleData struct.

Parameter

Description

Capsule type

Capsule layout types:

  • Image and text: The capsule displays an icon on the left and text on the right.

  • Timer: The capsule displays an icon on the left and timer text on the right.

  • Progress: The capsule displays overall progress, with an overlaid icon on the left and an overlaid percentage on the right. The progress value comes from the notification progress information.

Capsule status

When the Live Window notification is not visible, the application's live service displays as a Live Window capsule in the status bar. Options include the following:

  • Capsule display

  • Capsule end display

Status icon

Status icon, local resource. Use SVG format resources.

Alert

Whether to alert the user with animation during this capsule update. The number of alerts does not exceed 5 times during the entire capsule period.

  • Alert user

  • Do not alert user (default).

Capsule background color

The capsule background color, in "#ARGB" hexadecimal format. To prevent issues such as transparent backgrounds or overly bright colors, the color is converted before the capsule displays.

1. Set alpha to 255 to force solid display.

2. For colors with high saturation and brightness, saturation and brightness are appropriately reduced.

Capsule title

The main text for the capsule status, up to 128 characters.

When the capsule type is image and text, this field sets the capsule title.

Capsule content

The capsule status content, up to 128 characters. This extended text displays when the device is widescreen or in landscape orientation.

When the capsule type is image and text or timer, this field sets the capsule content.

Notification progress information:

Parameter

Description

Maximum progress value

The maximum progress value, which must be greater than 0.

Current progress value

The current progress value, which must be greater than or equal to 0 and less than or equal to the maximum progress value.

Infinite loop

Whether it is an infinite loop style:

  • Enabled: Progress displays as a percentage (default).

  • Disabled: Progress displays as a numerical ratio.

5. External screen display

In this section, enable the external screen display layout using a toggle button and configure display data for external screens, such as those on Pocket series phones. For corresponding fields, see the ExternalData struct.

Parameter

Description

External screen template type

External screen template types:

  • Default type (default)

  • Background image type

External screen background color

In "#RGB" hexadecimal format. If not set, the system default color is used.

External screen notification title

Custom external screen notification title, with a total length of up to 128 characters. If not set, the fallback notification title is used by default.

External screen notification content

Custom external screen notification content, composed of multiple RichText segments, with a total length of up to 128 characters. If not set, the fallback notification content is used by default.

External screen background image

External screen background image, local resource. When the external screen template type is a background image type, set it during the first image creation. It is optional for subsequent updates.

iOS Dynamic Island

1. Basic settings

Parameter

Description

Notification title

The title of the notification. It briefly describes the notification's content.

Notification subtitle

The subtitle for notifications on devices running iOS 10 or later. The subtitle appears below the notification title and provides extra information.

Notification body

The main content of the notification. It provides detailed information.

Push environment

Select the push environment.

Options include the following:

• Production environment

• Development environment

Push target

The DeviceID. This is the unique identity of a device in the push service.

Push timing

Set the send time for this push.

Options include the following:

• Send now

• Scheduled send: The scheduled time cannot be more than 7 days from now.

2. Dynamic Island configuration

Parameter

Description

Live Activity event type

The type of Live Activity event. It includes:

• start: Starts a Live Activity.

• update: Updates a Live Activity.

• end: Ends a Live Activity.

For limits, see the Event parameter of PushTask.

Live Activity ID

The Live Activity ID reported by the device to your server. For limits, see the Id parameter of PushTask.

Data model

The type of Live Activity to register. For limits, see the AttributesType parameter of PushTask.

Expiration time

The expiration time for the Dynamic Island activity. For limits, see the StaleDate parameter of PushTask.

Static parameter

Pass-through static parameters for the Dynamic Island push. The key-value pairs in the JSON are custom-defined by your service. For limits, see the Attributes parameter of PushTask.

Dynamic parameter

Pass-through dynamic parameters for the Dynamic Island push. The key-value pairs in the JSON are custom-defined by your service. For limits, see the ContentState parameter of PushTask.

Lock screen dismissal time

When a Live Activity ends, the Dynamic Island activity ends immediately. However, the Lock Screen activity remains until the dismissal time. For limits, see the DismissalDate parameter of PushTask.

HarmonyOS Live View

1. Basic Configuration

Parameter

Description

Push Target

Options:

  1. All: Send to all devices.

  2. Specific device: Send by device ID.

  3. Specific account: Send to accounts bound to the device ID.

  4. Specific alias: Send to aliases bound to the device ID.

  5. Device tag: Send to tags bound to the device ID.

Note
  1. When you select Specific device, Specific account, or Specific alias, you can upload a file containing device IDs, accounts, or aliases.

  2. Upload a UTF-8 encoded TXT file no larger than 30 MB. Each line must contain one record.

  3. Broadcast frequency limit: For the same AppKey and operating system, wait at least 1 second between two broadcasts. Also, you can send up to 10 broadcast notifications (including notifications converted from messages) in any 10-minute period. You can send up to 30 broadcast messages in any 10-minute period.

Push Timing

Set when to send this push.

Options:

• Send immediately

• Schedule send: Must be within 7 days.

The non-basic configuration follows the official HarmonyOS Live View specification exactly. All parameters pass through to the system unchanged. For full configuration details and the latest features, see HarmonyOS Live View Notifications.

2. Live View Configuration

Parameter

Description

Live View Notification Operation Type

Operation types for Live View messages:

  • Create: Creates a Live View message. Only event values FLIGHT, TAXI, and TRAIN are allowed. See Create Live View Constraints for details.

  • Update: Updates a Live View message (the Live View with the specified activityId must exist).

  • End: Ends a Live View message (the Live View with the specified activityId must exist).

When updating or ending a Live View, optional fields inherit the previous state if not provided and no default is defined.

Live View Identity

A unique identifier for the Live View. Valid values range from -2147483648 to 2147483647. Developers generate this value. Maps to the id field in Live View Kit.

Important

If the Live View with the specified activityId does not exist (in an update or end operation), that activityId cannot be used to send Live View messages for 24 hours.

Business Scenario

Valid business scenario values. For usage limits, see the event section in the HarmonyOS Live View Push Guide.

Live View Message Status

Required when the Live View notification operation type is Create, or when it is Update and the Live View being updated was created remotely via Mobile Push.

Status values depend on the scenario type. See Status Values.

To use the placeholder {{status}} in the message body, see Fields That Support Placeholders. When valid, the system replaces the placeholder with the target value.

Vendor Channel Notification Type

Vendor channel notification types:

  • Official Notification (default)

  • Test notification

Fallback Notification Title

Text shown in the notification shade when the system does not support Live View notifications.

Fallback Notification Content

Text shown in the notification shade when the system does not support Live View notifications.

Silent Notification

Whether the message update triggers a user alert.

  • Silent alert (default)

  • Vibration and sound alert

Live View Version Number

Version number of the updated Live View notification. Must be greater than or equal to 0. The new version number must be greater than the current version number. Otherwise, the refresh fails.

3. Message Notification Layout

Configure layout data for Live View message notifications in this section. For corresponding fields, see the NotificationData struct. Required parameters vary by layout type.

Parameter

Description

Layout Type

Includes:

  • Progress visualization: For activities showing progress milestones, such as food delivery, fresh produce delivery, or ride pickup status.

  • Emphasized text template: For displaying key information like pickup codes, package codes, or license plate numbers.

  • Left-right text template: For activities showing origin and destination, such as high-speed rail, trains, or flights.

  • Sports event: For sports scores or game scores.

Common parameters:

Parameter

Description

Live View Keyword

Keyword for the Live View. Required when the Live View notification operation type is Create and the business scenario is one of the following:

  • For FLIGHT: Only flightNo is supported. It represents the flight number. Placeholder format: {{flightNo}}.

    • Example:

      {
        "flightNo": "XX1234"
      }
  • For TRAIN: Only trainNo is supported. It represents the train number. Placeholder format: {{trainNo}}.

    Example:

    {
      "trainNo": "GXXXX"
    }

To use placeholders in the message body, see Fields That Support Placeholders.

Archive Period

How long the Live View notification remains in the notification center after ending. Default is 0 seconds (not archived). Maximum is 1 hour (3600 seconds).

The archive period uses the value passed in the End operation. During the archive period, you cannot update or end the notification again.

Notification Title

Title of the notification. Maximum length is 1024 characters.

Required when the Live View notification operation type is Create. Cannot be an empty string.

Notification Content

Content of the notification. Composed of multiple rich text (RichText) segments. Total length must not exceed 1024 characters. If you set text color, use only one color.

Required when the Live View notification operation type is Create. Cannot be an empty string.

Show Line Separator

Whether to show the line separator in the expanded area.

  • Enabled: Show (default)

  • Disabled: Hide

Assistant Area Display Type

Style of the assistant area. See the Extend struct for details.

Note

  • When changing to a new layout type, reconfigure this parameter.

  • If the assistant area display type is image and the image path is invalid, refreshing the Live View notification fails.

Click Behavior Type

Action taken when users tap the notification. See the ClickAction struct for details.

Custom Data

Data passed to your app when users tap the notification. See the data field in ClickAction for details.

Lock Screen Immersive Image

Image shown on the lock screen for immersive Live View. Value is the filename in the specified path.

Example: If the icon file “icon.png” is stored in your app’s “/resources/rawfile” path, the value is “icon.png”.

Progress visualization type:

Parameter

Description

Progress Percentage

Progress value from 0 to 100. Determines the position of the indicator on the progress bar.

Indicator Icon

Local resource. When not included, the system displays the image from the last refresh. When the operation type is Create and the indicator display type

As follows:

  • Display above the progress line

  • Display Overlaid on the Progress Line

Required, and cannot be an empty string.

Progress Color

Color of the progress point on the left side of the progress bar and node icons. Format: "#ARGB" (9-character hexadecimal). Default is blue.

Background Color

Color of the progress point on the right side of the progress bar and node icons. Format: "#ARGB" (9-character hexadecimal). Default is gray.

Node Icon

Icon for each node on the progress bar. Array length must be between 2 and 5. Local resource. If omitted, the system displays the last refreshed image. Required when the operation type is Create. Cannot be an empty array of strings.

Progress Display Type

Progress display type in the expanded area:

  • Dashed line (default)

  • Standard solid line progress indicator

  • Progress indicated by a thick solid line

Indicator Display Type

Small indicator icon display type in the expanded area:

  • Do not display (default)

  • Display above the progress line

  • Overlay on the progress line

Emphasized text template layout — specific parameters:

Parameter

Description

First-line Text

First-line text. Maximum length is 128 characters. Cannot be empty.

Second-line Text

Second-line text. Maximum length is 128 characters. Cannot be empty.

Underline Color

Underline color for the second-line text. Format: "#ARGB" (9-character hexadecimal). If not set, no underline appears.

Description Image

Description image for the expanded area. Not shown by default. When provided, appears on the right side of the expanded area. When omitted, the system uses the last image. See the descPic field in NotificationData for details.

Left-right text template layout — specific parameters:

  • Left text block

    Parameter

    Description

    First-line Text

    First-line text. Maximum length is 128 characters. Cannot be empty.

    Second-line Text

    Second-line text. Maximum length is 128 characters. Cannot be empty.

  • Left text block

    Parameter

    Description

    First-line Text

    First-line text. Maximum length is 128 characters. Cannot be empty.

    Second-line Text

    Second-line text. Maximum length is 128 characters. Cannot be empty.

    Separator Icon

    Local resource. Appears in the center of the expanded area.

Event type-specific parameters:

  • Home team

    Parameter

    Description

    Home Team Icon

    Team icon shown in the display area. Required when the operation type is Create. Cannot be empty.

    Value is the filename in the specified path.

    Example: If the icon file “icon.png” is stored in your app’s “/resources/rawfile” path, the value is “icon.png”.

    Home Team Name

    Team name.

    Home Team Score

    Match score.

  • Away team

    Parameter

    Description

    Away Team Icon

    Team icon shown in the display area. Required when the operation type is Create. Cannot be empty.

    Value is the filename in the specified path.

    Example: If the icon file “icon.png” is stored in your app’s “/resources/rawfile” path, the value is “icon.png”.

    Away Team Name

    Team name.

    Away Team Score

    Match score.

  • Match info

    Parameter

    Description

    Match Description

    Description text above the center of the expanded area.

    Match Time

    Match time below the center of the expanded area.

4. Capsule Layout

Enable capsule layout using the toggle button in this section. Configure capsule notification layout data. For corresponding fields, see the CapsuleData struct.

Parameter

Description

Capsule Type

Capsule layout types:

  • Icon + text: Shows an icon on the left and text on the right.

  • Timer: Shows an icon on the left and timer text on the right.

  • Progress: Shows overall progress, with an icon on the left and percentage or numeric value on the right.

Capsule State

Whether the capsule appears in the status bar for your Live View activity:

  • Show: Display the capsule.

  • Hide: Do not display the capsule.

State Icon

State icon. Local resource. We recommend a solid-color vector icon sized 18 × 18 vp.

Example: If the icon file “icon.svg” is stored in your app’s “/resources/rawfile” path, the value is “icon.svg”.

Animation Effect

Animation effect for the capsule in the status bar. No special effect is applied if omitted.

  • No special effect

  • Takeover animation: Capsule takes over another capsule’s position. Max 5 times per activity.

  • Auto-expand animation: Capsule expands into a floating card. Max 2 times per activity.

Capsule Background Color

Background color of the capsule. Format: "#ARGB" (9-character hexadecimal).

The following colors are not allowed:

  • #FF000000

  • #FFFFFFFF

  • #FFF1F3F5

Capsule Title

Main text for the capsule state. Maximum length is 128 characters.

Required when the operation type is Create and the layout type is Icon + text.

When the layout type is Icon + text, this field sets the capsule title.

Capsule Content

Maximum length is 128 characters. Shown as extended text on wide-screen or landscape devices.

Required when the operation type is Create and the layout type is Icon + text or Timer.

When the layout type is Icon + text or Timer, this field sets the capsule content.

Capsule timer:

Parameter

Description

Timer Initial Value

Initial value for the capsule timer. Refreshes every second. Unit: milliseconds. Default is 0.

Countdown

Whether the timer displays as a countdown.

  • Disabled: Count up (default)

  • Enabled: Count down

Pause

Whether the capsule timer is paused.

  • Disabled: Do not pause (default)

  • Enabled: Pause. When paused, the capsule shows the second at which it paused.

Capsule progress information:

Parameter

Description

Maximum Progress Value

Maximum progress value. Range: 1 to 2147483647.

Current Progress Value

Current progress value. Range: 0 to 2147483647. Must be less than or equal to the maximum progress value.

Infinite Loop

Progress display type.

  • Enabled: Show percentage

  • Disabled: Show numeric ratio

5. External Display

Enable external display layout using the toggle button in this section. Configure data for small external displays, such as those on Pocket series phone external screens. For corresponding fields, see the ExternalData struct.

Parameter

Description

External Display Template Type

This includes the following:

  • Default (default)

  • Type of background image

External Display Background Color

Format: "#RGB" (7-character hexadecimal). If not set, the system uses its default color.

External Display Notification Title

Custom title for the external display notification. Maximum length is 128 characters. Required when the operation type is Create. Cannot be empty.

External Display Notification Content

Custom content for the external display notification. Composed of multiple rich text (RichText) segments. Total length must not exceed 128 characters. If you set text color, use only one color.

External Display Background Image

Local resource. Required when the template type is Background image and creating the image for the first time. Optional for subsequent updates. Value is the filename in the specified path.

Push Real-Time Activity

  1. After you complete the configuration, click Push Notification to send the notification.