tencent cloud

Chat

製品の説明
製品の概要
Basic Concepts
ユースケース
機能概要
アカウントシステム
ユーザープロフィールとリレーションシップチェーン
メッセージ管理
グループシステム
Official Account
Audio/Video Call
使用制限
購入ガイド
課金概要
価格説明
Purchase Instructions
Renewal Guide
支払い延滞説明
Refund Policy
ダウンロードセンター
SDK & Demo ソースコード
更新ログ
シナリオプラン
Live Streaming Setup Guide
AI Chatbot
極めて大規模なエンターテインメントコラボレーションコミュニティ
Discord実装ガイド
ゲーム内IM統合ガイド
WhatsApp Channel-style Official Account Integration Solution
Send Red Packet
Firewall Restrictions
クライアントAPIs
SDK API(Web)
Android
iOS & macOS
Swift
Flutter
SDK API(Electron)
SDK APIs (Unity)
SDK API(React Native)
C APIs
C++
サービス側 APIs
UserSigの生成
RESTful APIs
Webhooks
コンソールガイド
New Console Introduction
アプリケーションの作成とアップグレード
基本設定
機能設定
アカウント管理
グループ管理
Official Channel Management
コールバック設定
監視ダッシュボード
Viewing Guide for Resource Packages
Real-Time Monitor
補助ツールの開発
アクセス管理
Advanced Features
よくあるご質問
uni-app FAQs
 購入に関する質問
SDKに関する質問
アカウント認証に関する質問
ユーザープロファイルとリレーションシップチェーンに関する質問
メッセージに関する質問
グループに関する質問
ライブ配信グループに関する質問
ニックネームプロフィール画像に関連した問題
一般的なリファレンス
Service Level Agreement
セキュリティコンプライアンス認証
IM ポリシー
プライバシーポリシー
データプライバシーとセキュリティ契約
エラーコード
お問い合わせ

Offline push V2TIMOfflinePushInfo.vendorParams description

フォーカスモード
フォントサイズ
最終更新日: 2026-01-12 11:41:00
This article introduces the field descriptions and usage example of offline push V2TIMOfflinePushInfo.vendorParams.

Field Description

Field
Type
Attribute
Usage Instructions
Remarks
fcmPriority
String
Optional.
FCM push message priority settings
"normal": Ordinary priority. When the app runs in the foreground, ordinary priority messages will be transmitted immediately. When the app runs in the background, message delivery may be delayed. For time-insensitive messages (such as new email notifications, keeping the interface synchronized, or syncing app data in the background), we recommend you select ordinary delivery priority.
"high": High priority. Even if the device is in low-power mode, FCM will immediately attempt to transmit high-priority messages. High-priority messages are suitable for time-sensitive, user-visible content.
None
vivoNotifyType
Integer
Optional.
vivo notification type:
None
2: Ring.
3: Vibration.
4: Ring and vibration.
Default value: 4.
None
oppoTemplateId
String
Optional.
The template ID for OPPO private message application. For the application method, see OPPO Private Message Channel:
The corresponding private message template must be carried when sending. Custom content is not supported.
Note:
The console also supports setting a template ID separately, primarily used to push messages in Chat scenarios (category = "IM"). Template ID takes effect:
After setting the template ID in console settings, the title and desc field contents of V2TIMOfflinePushInfo will be automatically filled with the template title and content, as follows:
{
"oppoTitleParam": {
"title":"titleInfo"
},
"oppoContentParam":{
"desc":"descInfo"
}
}
Application template example:
TemplateID: ID
Message Type: IM
Title: ${title}$
Content: ${desc}$
The above solution supports offline message adaptation for private message template feature in existing Chat scenarios, achieving the goal where existing users' Chat messages can still be delivered via private message channel. This method is also recommended for Chat-type messages to utilize private message templates.

oppoTitleParam
JSON
Optional.
OPPO title template fill parameters:
Example: Private message template ID title template: Welcome to ${city}, ${city} welcomes you.
The parameter content is: {"city":"Beijing"}
oppoContentParam
JSON
Optional.
OPPO content template fill parameters:
Example: Private message template ID content template: Welcome ${userName} to ${city}.
The parameter content is: {"userName":"Tom", "city":"Shenzhen city"}

Usage Example

Android
iOS
C++
Java
Kotlin
V2TIMOfflinePushInfo v2TIMOfflinePushInfo = new V2TIMOfflinePushInfo();
Map<String, Object> map = new HashMap<>();
map.put("fcmPriority", "high");
map.put("vivoNotifyType", 4);
map.put("oppoTemplateId", "oppoid");

Map<String, Object> oppoTitleMap = new HashMap<>();
oppoTitleMap.put("title", "title");
map.put("oppoTitleParam", new Gson().toJson(oppoTitleMap));

Map<String, Object> oppoContentMap = new HashMap<>();
oppoContentMap.put("desc", "desc");
map.put("oppoContentParam", new Gson().toJson(oppoContentMap));

String param = new Gson().toJson(map);
v2TIMOfflinePushInfo.setVendorParams(param);
val map = mutableMapOf<String, Any>(
"fcmPriority" to "high",
"vivoNotifyType" to 4,
"oppoTemplateId" to "oppoid"
)

val oppoTitleMap = mapOf("title" to "title")
map["oppoTitleParam"] = Gson().toJson(oppoTitleMap)

val oppoContentMap = mapOf("desc" to "desc")
map["oppoContentParam"] = Gson().toJson(oppoContentMap)

val param = Gson().toJson(map)
V2TIMOfflinePushInfo v2TIMOfflinePushInfo = new V2TIMOfflinePushInfo();
v2TIMOfflinePushInfo.setVendorParams(param)
OC
Swift
NSMutableDictionary *map = [@{
@"fcmPriority": @"high",
@"vivoNotifyType": @4,
@"oppoTemplateId": @"oppoid"
} mutableCopy];

NSDictionary *oppoTitleMap = @{@"title": @"title"};
NSData *titleData = [NSJSONSerialization dataWithJSONObject:oppoTitleMap options:0 error:nil];
NSString *oppoTitleJson = [[NSString alloc] initWithData:titleData encoding:NSUTF8StringEncoding];
[map setObject:oppoTitleJson forKey:@"oppoTitleParam"];

NSDictionary *oppoContentMap = @{@"desc": @"desc"};
NSData *contentData = [NSJSONSerialization dataWithJSONObject:oppoContentMap options:0 error:nil];
NSString *oppoContentJson = [[NSString alloc] initWithData:contentData encoding:NSUTF8StringEncoding];
[map setObject:oppoContentJson forKey:@"oppoContentParam"];

NSData *paramsData = [NSJSONSerialization dataWithJSONObject:map options:0 error:nil];
NSString *params = [[NSString alloc] initWithData:paramsData encoding:NSUTF8StringEncoding];

V2TIMOfflinePushInfo *v2TIMOfflinePushInfo = [[V2TIMOfflinePushInfo alloc] init];
v2TIMOfflinePushInfo.vendorParams = params;
var map: [String: Any] = [
"fcmPriority": "high",
"vivoNotifyType": 4,
"oppoTemplateId": "oppoid"
]

let oppoTitleMap: [String: String] = ["title": "title"]
if let titleData = try? JSONSerialization.data(withJSONObject: oppoTitleMap),
let oppoTitleJson = String(data: titleData, encoding: .utf8) {
map["oppoTitleParam"] = oppoTitleJson
}

let oppoContentMap: [String: String] = ["desc": "desc"]
if let contentData = try? JSONSerialization.data(withJSONObject: oppoContentMap),
let oppoContentJson = String(data: contentData, encoding: .utf8) {
map["oppoContentParam"] = oppoContentJson
}

let paramsData = try! JSONSerialization.data(withJSONObject: map)
let params = String(data: paramsData, encoding: .utf8)!

let v2TIMOfflinePushInfo = V2TIMOfflinePushInfo()
v2TIMOfflinePushInfo.vendorParams = params;
#include <sstream>
#include <string>

V2TIMOfflinePushInfo offline_push_info;
//std::string param = R"({"fcmPriority":"high","vivoNotifyType":4})";

std::ostringstream param;
// Build the main struct
param << "{";
param << "\\"fcmPriority\\":\\"high\\",";
param << "\\"vivoNotifyType\\":4,";
param << "\\"oppoTemplateId\\":\\"oppoid\\",";

// Build the json string of oppoTitleParam
std::string oppo_title_json = "{\\"title\\":\\"title\\"}";
param << "\\"oppoTitleParam\\":\\"";
for (const char c : oppo_title_json) {
// Escape double quotes in nested json
if (c == '"') oss << '\\\\';
oss << c;
}
param << "\\",";

// Build the json string of oppoContentParam
std::string oppo_content_json = "{\\"desc\\":\\"desc\\"}";
param << "\\"oppoContentParam\\":\\"";
for (const char c : oppo_content_json) {
if (c == '"') oss << '\\\\';
oss << c;
}
param << "\\"}";
offline_push_info.vendorParams = param.str();
Note:
IMSDK 8.7 and above versions support.

API Reference

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック