This module provides common information of Push Kit, including the bound account type, scenario-specific message data PushPayload, extended notification message data, target content for an extended notification, data configured for the event to be triggered upon message tapping, and in-app call message data.
Model restriction: This API can be used only in the stage model.
System capability: SystemCapability.Push.PushService
Start version: 4.0.0(10)
Enumerated values of the bound account type.
Model restriction: This API can be used only in the stage model.
System capability: SystemCapability.Push.PushService
Start version: 4.0.0(10)
Name | Value | Description |
|---|---|---|
PROFILE_TYPE_OS_DISTRIBUTED_ACCOUNT | 1 | HUAWEI ID. |
PROFILE_TYPE_APPLICATION_ACCOUNT | 2 | Account in the app's own account system. |
An app can use receiveMessage() to obtain the parameter definition of scenario-specific message data.
Model restriction: This API can be used only in the stage model.
System capability: SystemCapability.Push.PushService
Start version: 4.0.0(10)
Parameter | Type | Read-only | Optional | Description |
|---|---|---|---|---|
type | string | No | No | Message type transferred to the Ability. |
data | string | No | No | Data transferred to the Ability.
|
Extended notification message data, which is inherited from PushPayload.
Model restriction: This API can be used only in the stage model.
System capability: SystemCapability.Push.PushService
Start version: 4.1.0(11)
Parameter | Type | Read-only | Optional | Description |
|---|---|---|---|---|
id | number | No | No | Notification ID. |
type | string | No | No | Message type transferred to RemoteNotificationExtensionAbility. This parameter is inherited from PushPayload. |
data | string | No | No | Data transferred to RemoteNotificationExtensionAbility. This parameter is inherited from PushPayload. |
Target content of an extended notification.
Model restriction: This API can be used only in the stage model.
System capability: SystemCapability.Push.PushService
Start version: 4.1.0(11)
Parameter | Type | Read-only | Optional | Description |
|---|---|---|---|---|
title | string | No | Yes | Title of an extended notification. NOTE: The title parameter is optional since version 5.0.0(12). |
text | string | No | Yes | Content of an extended notification. NOTE: The text parameter is optional since version 5.0.0(12). |
overlayIcon | image.PixelMap | No | Yes | Overlay icon of an extended notification. NOTE: It is recommended that the image width x height be less than 128 x 128 pixels. Images larger than 49,152 pixels will not be displayed. |
badgeNumber | number | No | Yes | Badge number increment (but not the actual badge number displayed) during the display of an extended notification. |
setBadgeNumber | number | No | Yes | Badge number displayed for an extended notification. If both this parameter and badgeNumber are returned, this parameter takes precedence over badgeNumber. NOTE: Start version: 5.0.0(12). |
wantAgent | PushCommon.RemoteWantAgent | No | Yes | Data configured for the action to be triggered upon message tapping. |
Data configured for the action to be triggered upon message tapping.
Model restriction: This API can be used only in the stage model.
System capability: SystemCapability.Push.PushService
Start version: 4.1.0(11)
Parameter | Type | Read-only | Optional | Description |
|---|---|---|---|---|
abilityName | string | No | No | Custom page name. |
parameters | Record<string, Object> | No | Yes | Data transferred to an app. |
In-app call message data, which is inherited from PushPayload.
Model restriction: This API can be used only in the stage model.
System capability: SystemCapability.Push.PushService
Start version: 4.1.0(11)
Parameter | Type | Read-only | Optional | Description |
|---|---|---|---|---|
callId | string | No | No | Unique ID of a call. |
type | string | No | No | Message type transferred to VoIPExtensionAbility. This parameter is inherited from PushPayload. |
data | string | No | No | Data transferred to VoIPExtensionAbility. This parameter is inherited from PushPayload. |