tencent cloud

Chat

DokumentasiChatPush ServiceREST APICommon Parameters (OfflinePushInfo Description)

Common Parameters (OfflinePushInfo Description)

Unduh
Mode fokus
Ukuran font
Terakhir diperbarui: 2026-11-11 19:33:41

Push OfflinePushInfo Description

OfflinePushInfo is a JSON Object dedicated to notification bar push configuration, allowing you to configure whether to close the push, push title description, text description, push passthrough, and related parameters of push vendors.

Standard Notification Push

Marketing news push
Private message push
{
// other parameters...
"OfflinePushInfo": {
"PushFlag": 0,
"Title":"Offline Push Title",
"Desc": "offline push content",
"Ext": "{\\"entity\\":{\\"key1\\":\\"value1\\",\\"key2\\":\\"value2\\"}}", // passthrough field, push uses string in json format
"AndroidInfo": {
"Sound": "shake", // ringtone filename, without suffix
"OPPOChannelID": "oppo_channel_id",
"OPPOCategory": "MARKETING", // OPPO message categorization: content and marketing
"VIVOCategory": "MARKETING", // VIVO message categorization: operational messages
"HuaWeiCategory": "MARKETING", // Huawei message category: information marketing
"HonorImportance": "LOW" // Honor message category: information marketing
},
"ApnsInfo": {
"Sound": "apns.mp3", // ringtone filename, with suffix
"BadgeMode": 1,
"Title":"apns title",
"SubTitle":"apns subtitle",
"Image":"www.image.com",
"MutableContent": 1
}
}
}
{
// other parameters...
"OfflinePushInfo": {
"PushFlag": 0,
"Title":"Offline Push Title",
"Desc": "offline push content",
"Ext": "{\\"entity\\":{\\"key1\\":\\"value1\\",\\"key2\\":\\"value2\\"}}", // passthrough field, recommended string in json format
"AndroidInfo": {
"Sound": "shake", // ringtone filename, without suffix
"OPPOChannelID": "oppo_channel_id",
"VIVOCategory": "IM", // vivo message categorization: system message
"HuaWeiCategory": "IM", // Huawei message category: service and communication
"HonorImportance": "NORMAL", // Honor message category: service communication
"XiaoMiTemplateId": "xxxx", // Mi Push private message template id
"XiaoMiTemplateParam": { // Mi Push private message template parameters in json format
"keywords1": "k1",
...
},
"OPPOCategory": "IM", // OPPO message category: communication and service
"OPPOPrivateMsgTemplateId": "xxxx", // OPPO private message template id
"OPPOPrivateTitleParameters": { // OPPO private message title template parameters in json format
"k1": "v1"
...
},
"OPPOPrivateContentParameters": { // OPPO private message content template parameters in json format
"k1": "v1",
...
},
},
"ApnsInfo": { ... } // For details, refer to the ApnsInfo field description
}
}

APNs Passthrough Push

{
// other parameters...
"OfflinePushInfo": {
"Ext": "{\\"entity\\":{\\"key1\\":\\"value1\\",\\"key2\\":\\"value2\\"}}", // passthrough field, push uses string in json format
"ApnsInfo": {
"ContentAvailable": 1 // APNs Transparent Push Feature
},
"AndroidInfo": { ... } // For details, see AndroidInfo field description
}
}

APNs VoIP Push

{
// other parameters...
"OfflinePushInfo": {
"Title":"Offline Push Title", // Fallback to ordinary Notification push Title when recipient's VoIP token is not reported
"Desc": "Offline Push Content", // Fallback to ordinary Notification push Desc when recipient's VoIP token is not reported
"Ext": "{\\"entity\\":{\\"key1\\":\\"value1\\",\\"key2\\":\\"value2\\"}}", // passthrough field, push uses string in json format
"ApnsInfo": {
"IsVoipPush": 1 // APNs VoIP Push
},
"AndroidInfo": { ... } // For details, see AndroidInfo field description
}
}

APNs LiveActivity (Dynamic Island) Push

For specific fields, see the LiveActivity field descriptions. For client-side configuration, refer to Implementing Live Activity (Dynamic Island) functionality. Remote start of Live Activity supported on iOS 17.2 and later devices. Update/End Live Activity supported on iOS 16.1 and later devices.
Remote start of Live Activity
Update Live Activity
End Live Activity
{
// other parameters...
"OfflinePushInfo": {
"Title": "Offline Push Title",
"Desc": "Offline push content",
"Ext": "{\\"entity\\":{\\"k1\\":\\"v1\\",\\"k2\\":\\"v2\\"}}", // passthrough field, push uses string in json format
"ApnsInfo": {
"LiveActivity": {
"Event": "start", // start LiveActivity
"AttributesType": "AdventureAttrs",
"Attributes":{
"k1": "v1",
"k2": "k2",
...
},
"ContentState": {
"k1": "v1",
"k2": "v2",
...
}
}
},
"AndroidInfo": { ... } // For details, see AndroidInfo field description
}

{
// other parameters...
"OfflinePushInfo": {
"Title": "Offline Push Title",
"Desc": "Offline push content",
"Ext": "{\\"entity\\":{\\"k1\\":\\"v1\\",\\"k2\\":\\"v2\\"}}", // passthrough field, push uses string in json format
"ApnsInfo": {
"LiveActivity": {
"LaId": "timpush",
"Event": "update", // Update LiveActivity push
"ContentState": {
"k1": "v1",
"k2": "v2",
...
}
}
},
"AndroidInfo": { ... } // For details, see AndroidInfo field description
}
}
{
// other parameters...
"OfflinePushInfo": {
"Title": "Offline Push Title",
"Desc": "Offline push content",
"Ext": "{\\"entity\\":{\\"k1\\":\\"v1\\",\\"k2\\":\\"v2\\"}}", // passthrough field, push uses string in json format
"ApnsInfo": {
"LiveActivity": {
"LaId": "timpush",
"Event": "end", // End LiveActivity push
"ContentState": {
"k1": "v1",
"k2": "v2",
...
},
"DismissalDate": 1739502750
}
},
"AndroidInfo": { ... } // For details, see AndroidInfo field description
}
}

Multi-language Push

{
// other parameters...
"OfflinePushInfo": {
"PushFlag": 0,
"Title":"Offline Push Title",
"Desc": "offline push content",
"MultiLanguageContent":[
{
"Language":"ko",
"Title":"오프라인 푸시 제목",
"Desc":"오프라인 푸시 내용"
},
{
"Language":"en",
"Title":"Offline Push Notification Title",
"Desc":"Offline Push Notification Desc"
}
],
"Ext": "{\\"entity\\":{\\"key1\\":\\"value1\\",\\"key2\\":\\"value2\\"}}", // passthrough field, push uses string in json format
"AndroidInfo": { ... } // For details, see AndroidInfo field description
"ApnsInfo": { ... } // For details, refer to the ApnsInfo field description
}
}

Template-based Push

Template preset variables (Chat message push only)
Template custom variables
{
// Other parameters...
"OfflinePushInfo": {
"PushFlag": 0,
"Title":"Offline Push Title",
"Desc": "Offline Push Content",
"PushTemplateId":"1400000000-1" // If the template only contains preset variables, PushTemplateParam is not required
}
}
{
// Other parameters...
"OfflinePushInfo": {
"PushFlag": 0,
"Title":"Offline Push Title",
"Desc": "Offline Push Content",
"PushTemplateId":"1400000000-2",
"PushTemplateParam":{"UserName":"aaaa","ProductID":"bbbb"}
}
}

OfflinePushInfo Field Description

Field
Type
Attribute
Description
PushFlag
Integer
Optional
0: Display a notification in the notification bar when running in the background.
1: Do not display a notification in the notification bar when running in the background.
ForegroundShow
String
Optional
Defaults to empty, which means whether to display the notification bar message is determined by the client configuration. For details, refer to the documentation.
"show": Display the notification bar message in the foreground. Supported only by TIMPUSH SDK version >= `9.0.7652`.
"hide": Do not display the notification bar message in the foreground. Supported only by TIMPUSH SDK version >= `9.0.7652`.
Title
String
Optional
Notification bar push title.
Desc
String
Optional
Notification bar push title.
MultiLanguageContent
Array [ Object ]
Optional
Multilingual push content. The backend matches the push content based on the terminal's system language. If no match is found, the default Title and Desc are used. The feature requires SDK version 8.5.6870 or higher. Example code please see Multilingual Push.
Language
String
Optional
Title and Desc language flags. For details, please refer to Multilingual Code Table.
Ext
String
Optional
Offline Push Passthrough Content. Since domestic Android phone manufacturers have different requirements for push platforms, ensure this field is in JSON format, otherwise it may cause failed delivery for specific manufacturers' offline push.
AndroidInfo
JSON Object
Optional
Android message push control parameters. For specific fields, see AndroidInfo field description.
ApnsInfo
JSON Object
Optional
APNs message push control parameters. For specific fields, see ApnsInfo field description.
BadgeAddNum
Integer
Optional
Sets the increment value for the badge number, adding to the current badge count.
APNs Push: Value range: [1-99]. If both BadgeAddNum and BadgeSetNum are present, BadgeSetNum takes precedence. If neither is set, refer to ApnsInfo.BadgeMode.
Huawei/Honor Push: Value range: [1-99]. If both BadgeAddNum and BadgeSetNum are present, BadgeSetNum takes precedence. If neither is set, the badge number increments by 1.
For other push vendors: This field has no effect.
BadgeSetNum
Integer
Optional
Set badge number.
For APNs push, the value range is [0~999].
For Huawei/Honor push, the value range is [0~99].
For other push vendors, this field will not take effect.
In other cases, refer to BadgeAddNum for badge accumulation.
PushTemplateId
String
Optional
Push template ID. You must create the template in Push Settings in advance. Format: 1400000000-1. If omitted, the system default push style is used.
Note:
If template contains preset variables, it is only supported in Chat scenarios; pure Push scenarios (for example single push) will return an error.
PushTemplateParam
JSON Object
Optional
Template fill parameters used to fill custom variables. Example: If template title is {{UserName}} Order Notification, pass {"UserName":"aaaa"} here.
Note:
The following variables are auto-filled by system and should not be provided in PushTemplateParam:
timTitle: replaced by original push title.
timDesc: replaced by original push content.
timSenderNick: replaced by sender nickname.
timGroupName: replaced by group name for group chat, empty string for C2C chat.

AndroidInfo Field Description

Note:
The following fields support default values configured on the console certificate page: XiaoMiChannelID, OPPOChannelID, OPPOCategory, VIVOCategory, HuaWeiCategory, HuaWeiChannelID, and MeiZuNoticeMsgType. When set through the REST API or SDK, the value passed in the API request takes precedence. If the field is not passed in the request, the default value configured in the certificate will be used.
Field
Type
Attribute
Description
Sound
String
Optional
Android system notification ringtone filename, without suffix. For example, setting it to "shake" refers to the local file "/res/raw/shake.xxx" in the corresponding application.
PushStyle
Integer
Optional
Android notification bar style. "0" represents the default style, "1" represents the large text style. If left blank, it defaults to 0. Only applicable to Huawei, Honor, and OPPO.
XiaoMiChannelID
String
Optional
Mi Push notification category (Channel) adaptation fields for MIUI 10 or higher.
When this field is not empty, it overwrites the ChannelID value in the console push certificate configuration.
XiaoMiTemplateId
String
Optional
Xiaomi push private message template ID. Required when sending a template-based push notification. For details, see the Xiaomi Push Template Integration Guide.
When a template ID is specified, XiaoMiChannelID must also be set to the channel ID associated with the template.
When this field is specified, the notification title and body are generated from the corresponding template.
XiaoMiTemplateParam
JSON Object
Optional
Mi Push template parameters. For example: {"keywords1": "k1"}.
The format must be consistent with the parameters preconfigured for the corresponding template.
The number of parameters must be consistent with the number of parameters preconfigured for the corresponding template.
Parameter value requirements: 1–128 characters in length; cannot consist only of spaces; emoji and special symbols are not supported (Unicode Other Symbol category, i.e., \\p{So}); unassigned Unicode characters are not supported.
OPPOChannelID
String
Optional
OPPO Push notification channel adaptation fields for Android 8.0 or higher.
When this field is not empty, it overwrites the ChannelID value in the console push certificate configuration.
OPPOCategory
String
Optional
OPPO push message categorization, used to identify message type. For details, see category description.
When this field is not empty, it overwrites the category value in the console push certificate configuration.
OPPOPrivateMsgTemplateId
String
Optional
OPPO push private message template ID. Required when sending a template-based push notification. For details, see "OPUSH Private Message Template Verification".
The template must be applied for and approved on the OPPO Push platform in advance.
This field has no effect if OPPOCategory is set to the Content and Marketing category.
When this field is specified, the notification title and body are generated from the corresponding template.
OPPOPrivateTitleParameters
JSON Object
Optional
OPPO push private message template title parameters. Title template example is: welcome to ${city}$, ${city}$ welcomes you. The parameter content is: {"city":"Beijing"}
OPPOPrivateContentParameters
JSON Object
Optional
OPPO push private message template content parameters. Content template example is: {"userName":"Tom", "city":"Shenzhen city"}
OPPONotifyLevel
Integer
Optional
OPPO push notification bar message reminder level value definition. For details, see notify_level description. When using OPPONotifyLevel, OPPOCategory is required.
1: Notification bar
2: Notification bar + lock screen
16: Notification bar + lock screen + banner + vibration + ringtone
VIVOCategory
String
Optional
vivo push message categorization, used to identify message type. For details, see category description.
When this field is not empty, it overwrites the category value in the console push certificate configuration.
VIVOTemplateId
String
Optional
vivo push private message template ID. Required when sending a template-based push notification. For details, see the vpush Message Template Integration Guide.
The template must be applied for and approved on the vivo Push platform in advance.
When this field is specified, the notification title and body are generated from the corresponding template.
VIVOTemplateParams
JSON Object
Optional
Variable parameters for the vivo push private message template. Example: {"keywords1": "k1", "keywords2": "k2"}. The keys must match the variable names preconfigured in the corresponding template.
VIVONotifyType
String
Optional
Notification Type 1: None, 2: Ring, 3: Vibrate, 4: Ring and Vibrate. Default setting is 4, see notifyType.
HuaWeiImportance
String
Optional
Huawei push messaging reminder level, value is LOW, NORMAL.
HuaWeiCategory
String
Optional
Huawei push message classification, used to identify message type. For details, see category description.
When this field is not empty, it overwrites the category value in the console push certificate configuration.
HuaWeiImage
String
Optional
Small icon URL for Huawei push notifications in the notification bar. The URL must use HTTPS protocol. Example: https://example.com/image.png. The image file must be less than 512KB, with a recommended size of 40dp x 40dp and a corner radius of 8dp. Images exceeding the recommended size may be compressed or not fully displayed. Recommended image formats are JPG, JPEG, or PNG.
HonorImage
String
Optional
Icon URL for Honor push notifications in the notification bar. The URL must use HTTPS protocol. Example: https://example.com/image.png. The icon must be less than 512KB, with a recommended size of 40dp x 40dp and a corner radius of 8dp. Icons exceeding the recommended size may be compressed or not fully displayed.
HuaWeiChannelID
String
Optional
Huawei Push notification channel field for EMUI 10.0 or higher.
When this field is not empty, it overwrites the ChannelID value in the console push certificate configuration.
HonorImportance
String
Optional
Categorization for Honor push messages, with values LOW or NORMAL. For details, refer to Honor Message Categorization.
GoogleNotificationMode
String
Optional
FCM message mode. Valid values: notification and data.
notification (notification message): The system displays the notification directly in the notification tray.
data (data message): No notification is displayed. The SDK delivers the push payload to the application via a local broadcast. Supported only in TIMPUSH plugin versions ≥ 9.1.7824.
If omitted: Uses the message mode configured for the FCM push certificate in the console.
GooglePriority
String
Optional
FCM Push Notification Message Priority, see priority.
normal: When the device is in the foreground, messages are delivered immediately. When the device is in the background or Doze mode, messages are delivered in batches with a delay.
high: Regardless of the device's state (background/Doze/foreground), messages wake up the device and are delivered immediately.
GoogleChannelID
String
Optional
FCM Push notification channel fields for Android 8.0 or higher.
GoogleImage
String
Optional
Icon URL for FCM push notifications in the notification bar. The image resource must not exceed 1MB, supporting JPG, JPEG, or PNG formats. Example: https://example.com/image.png.
GoogleTTL
Integer
Optional
FCM message time to live (TTL), in seconds. If the message cannot be delivered to the device immediately (for example, because the device is offline), FCM may retain it and attempt delivery within the TTL. Once the TTL expires, FCM no longer attempts delivery.
0 (default): Equivalent to omitting this field. No TTL is specified through this parameter, and FCM handles the message according to its default behavior.
1–2419200: Specifies the message TTL, up to 28 days. Once the TTL expires, FCM no longer attempts delivery.

ApnsInfo Field Description

Field
Type
Attribute
Description
Title
String
Optional
This field is used to specify the title of APNs push. If filled, it will overwrite the top-level Title.
SubTitle
String
Optional
This field is used to specify the subtitle of APNs push.
Sound
String
Optional
iOS system notification ringtone filename, with suffix. Custom ringtone length cannot exceed 30s. The audio file must be added to the Xcode project first. Example value: shake.mp3.
Image
String
Optional
This field is used to specify the image address carried by APNs. When the client receives this field, the image can be displayed in the popup by downloading the image resource.
BadgeMode
Integer
Optional
0 means counting is required, 1 means this message does not count, and the upper right corner icon number does not increase.
Note:
The default value is 0 in Chat scenarios and 1 in non-Chat scenarios (such as calling the single push API).
InterruptionLevel
String
Optional
The notification level for iOS 15+ push notifications can only be one of active, critical, passive, or time-sensitive. For details, please refer to: APNs InterruptionLevel description.
Priority
Integer
Optional
APNs notification priority. If omitted, APNs defaults to 10. For more details, see APNs notification priority.
10 : Send the notification immediately.
5 : Send the notification based on power considerations on the user's device.
1 : Prioritize the device's power considerations over all other factors for delivery, and prevent awakening the device.
MutableContent
Integer
Optional
Set to 1 to enable push extension for iOS 10+. Default is 0.
TTL
Integer
Optional
APNs message time to live (TTL), in seconds. If the message cannot be delivered to the device immediately (for example, because the device is offline), APNs may retain it and attempt delivery within the TTL. Once the TTL expires, APNs no longer attempts delivery.
0 (default): Equivalent to omitting this field. No TTL is specified through this parameter, and APNs handles the message according to its default behavior.
1–2592000: Specifies the message TTL, up to 30 days. Once the TTL expires, APNs no longer attempts delivery.
ContentAvailable
Integer
Optional
1 indicates a silent push for iOS, with no popup in the notification banner. Apple recommends sending no more than 3 silent messages per hour. For details, please refer to: APNs Background Notification.
IsVoipPush
Integer
Optional
1 indicates a VoIP push for iOS. If the recipient does not provide a VoIP token, it will be automatically downgraded to a regular APNs notification push.
LiveActivity
JSON Object
Optional
LiveActivity push control parameters. For specific fields, see LiveActivity field description. If the LaId is invalid or the corresponding token has not been reported, it will automatically downgrade to a regular APNs Notification push.
NoFallback
Integer
Optional
0 (default): VoIP push and LiveActivity push automatically downgrade to regular push upon failure.
1: VoIP push and LiveActivity push are prohibited from automatic downgrading and will end the push upon failure.
LiveActivity Field Description
Field
Type
Attribute
Description
Event
String
Required
Push event type for Live Activity: fill in "start" to start, "update" to update, and "end" to end. For details, refer to Implementing Live Activity (Dynamic Island) functionality. For an introduction to Live Activity in APNs, refer to the APNs documentation.
AttributesType
String
Optional
Required when Event is "start". The name of the Live Activity attributes type, which must exactly match the name of the attributes type struct defined on the client.
Attributes
JSON Object
Optional
Required when Event is "start". A custom key:value object representing the static attributes declared in the Live Activity attributes type, used to initialize the Live Activity. Must match the values of the client SDK.
LaId
String
Optional
Required when Event is "update" or "end". The Live Activity identifier, corresponding to the client activityID, with a length not exceeding 64 bytes.
ContentState
JSON Object
Required
Required when Event is "start", "update", or "end". A custom key:value object representing the dynamic attributes declared in the Live Activity attributes type. Must match the values of the client SDK.
DismissalDate
Integer
Optional
When Event is "end", the Unix time at which the Live Activity ends its display on the lock screen. Defaults to the current time, dismissing the lock screen activity immediately.
Note:
Since APNs push restrictions limit packet size to 4K, exclude other control fields and keep the sum of Desc and Ext fields under 3K.
If offline push is needed, strongly recommend the sender to specify OfflinePushInfo.Title and OfflinePushInfo.Desc. For C2C/group messages, if OfflinePushInfo.Title and OfflinePushInfo.Desc are not filled in, the fallback logic will attempt to convert and retrieve Title and Desc from MsgBody for offline push.

Notification Title and Content Length Limits

Push Platform
Title Length Limit
Content Length Limit
Over-Length Handling Rule
Huawei
60
600
When the title or content exceeds the length limit of the corresponding channel, it will be automatically truncated to the limit length with ... (ellipsis) appended at the end (occupying 3 units). That is, the actual retained content is limit length − 3 units.
HONOR
50
400
Mi
50
128
OPPO
50
50 (128 for long text push, i.e., when AndroidInfo.PushStyle = 1)
vivo
40
100
Meizu
32
100
Note:
The length limits listed above are measured in UTF-16 code units.
Common characters (Chinese, English, digits, common punctuation): each character counts as 1 unit.
Certain special characters (such as most emoji like 😀🎉, and some rare CJK characters): each character counts as 2 units.
Composite emoji (such as 👋🏽, 👨‍👩‍👧, etc.): composed of multiple characters, where the total unit count is the sum of each individual character's units, and may well exceed 2 units.

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan