消息中心是指创建、编辑和收纳各类消息的功能模块。
包含消息中心 SDK 和配置文件,SDK 可用于实现消息中心在移动端的展示,配置文件可用于自定义移动端消息中心的样式。
在融云开发者平台可以访问管理后台,进行消息素材的编辑和投放。
配置文件用于构造 RCUserInfo 的对象。其中的参数信息,需要提供给客户端开发人员和运营人员,以便能够正确的实现消息中心相关消息的发送和保存。
客户端开发人员:读取配置文件中的数据,设置用户信息缓存,并且会根据数据进行布局设置。
布局注释截图:
运营人员:登录开发者平台,进入“运营管理”页面。将配置文件中的 id 信息,添加到消息中心/分类设置中,以保证后台投放消息能够正确发送到指定的 id 中。
{
"h-users": [
{
"id": "rong_system_trading",
"name": "交易信息",
"portrait": "https://rongcloud-res.cn.ronghub.com/6fb522d997abb6e7fda21b090593b8a6"
},
{
"id": "rong_system_notice",
"name": "系统通知",
"portrait": "https://rongcloud-res.cn.ronghub.com/029050d88b0d75a3507550eaf7ce63ed"
},
{
"id": "rong_system_event",
"name": "活动福利",
"portrait": "https://rongcloud-res.cn.ronghub.com/125c94ebe629dc0b539f2126f01a105b"
}
],
"v-users": [
{
"id": "rong_system_community",
"name": "社区消息",
"portrait": "https://rongcloud-res.cn.ronghub.com/381b9fe0009d146035d6356e30cd2a4a"
},
{
"id": "rong_system_interaction",
"name": "互动消息",
"portrait": "https://rongcloud-res.cn.ronghub.com/808ce1ebad4aba400491ce0005ea75de"
}
],
"display-friends": true
}
建议配置文件由应用服务器端生成,将一致的配置文件提供给运营人员和客户端开发人员。
h-users 和 v-users 中的每一个数据元素由 "id"、"name" 和 "portrait" 组成:
"id":发送“消息中心”消息的 UserId。
"name":客户端本地通知栏中显示的昵称。
"portrait":消息展示页面中,接收消息中需要展示的头像地址。
客户端开发人员需要从配置文件中读取这些数据模型,构造 RCUserInfo 的对象,并将构造的对象刷新到用户信息缓存中。
iOS 端示例代码:
- (void)loadUserInfo:(NSArray*)userInfoList {
if (userInfoList.count > 0) {
//从配置文件中读取用户信息列表,并刷新用户信息缓存。
for (NSDictionary *user in userInfoList) {
RCUserInfo *userInfo = [RCUserInfo new];
userInfo.userId = user[@"id"];
userInfo.name = user[@"name"];
userInfo.portraitUri = user[@"portrait"];
[[RCIM sharedRCIM] refreshUserInfoCache:userInfo withUserId:userInfo.userId];
}
}
}
由于消息中心是基于融云的 IMKit 和 IMLib 开发的,所以需要开发者在集成消息中心之前,先要了解融云 SDK 的使用。 融云 SDK 文档连接
导入 “users_config.json” 配置文件。
在初始化融云 SDK 后,注册需要显示的消息类型,以官方 Demo 中 RCDTestMessage 为例子:
[[RCIM sharedRCIM] registerMessageType:[RCDTestMessage class]];
在消息中心 Demo 中,创建了 RCMCDMessageManager 消息管理类,用于注册所有消息中使用到的消息类型。
注意事项:如果不注册消息,消息中心的消息展示页面无法正常显示消息。
继承 RCMCViewController 创建子类,根据业务需求放到对应的位置。重写下面方法,其中 RCMCDChatViewController 是 RCMCMessageDisplayViewController 的子类
-(void)gotoChatView:(NSString *)targetId title:(NSString *)title {
RCMCDChatViewController *chatVC = [RCMCDChatViewController new];
chatVC.conversationType = ConversationType_SYSTEM;
chatVC.targetId = targetId;
chatVC.title = title;
[self.navigationController pushViewController:chatVC animated:YES];
}
RCMCDChatViewController 类中可以重写消息 cell 的点击方法,在方法中实现页面跳转,完成业务逻辑。
实现远程推送,推送文档
点击通知栏跳转知识库,在系统方法中获取远程推送的内容,在 "rc":{"cType":"PR","fId":"xxx","oName":"xxx","tId":"xxxx"},中可以得到会话类型—— cType 和会话 Id——tID,通过这些信息可以标识一个唯一的会话,使用下面代码创建一个 RCMCMessageDisplayViewController 子类的对象,替换点击通知栏跳转知识库中系统方法中的聊天页面对象,实现跳转逻辑即可。
RCMCDChatViewController *vc = [[RCMCDChatViewController alloc] init];
vc.conversationType = cType;
vc.targetId = tID;
如果不使用融云的推送通道,需要在点击通知栏时候,按照规定好的格式解析推送内容,并实现页面跳转。
/**
点击内容跳转的Url
*/
@property(nonatomic, copy) NSString *contentUrl;
如果消息的 contentUrl 中携带了自定义的 uri 地址,客户端可以使用第三方库进行解析,并跳转到应用内的指定页面。
例:
contentUrl = @"mcenter://mcenterdemo/messagedisplayviewcontroller/system/rong_system_trading";
如果 contentUrl 是自定义的 uri,建议客户端开发人员可以使用 JLRoutes 这个第三方库对 uri 进行解析,正常解析后应该执行下面代码,跳转到相应的消息展示页面。
RCMCDChatViewController *chatVC = [RCMCDChatViewController new];
chatVC.conversationType = ConversationType_SYSTEM;
chatVC.targetId = @"rong_system_trading";
[self.navigationController pushViewController:chatVC animated:YES];
消息中心模块是在 IM SDK
的基础上对SDK的一次封装。提取了特定 id 发来的系统消息,在原 IM SDK
会话列表中取出消息中心的消息,实现消息运营。
MCenter
MCenter
,IMKit
、IMLib
这三个 module。配置消息中心列表,新建 Activity ,集成 MessageCenterListFragment
:
private void initMessageListFragment() {
MessageCenterListFragment messageCenterListFragment = new MessageCenterListFragment();
messageCenterListFragment.init(this);
getSupportFragmentManager().beginTransaction()
.add(R.id.rl_mcenterlist, messageCenterListFragment).commitAllowingStateLoss();
}
配置 intent-filter
:
<activity
android:name=".activity.MessageCenterListActivity"
android:launchMode="singleTop"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="packagename"
android:pathPrefix="/conversationlist"
android:scheme="rong" />
</intent-filter>
</activity>
配置会话页面,新建 Activity ,集成 MCConversationFragment
,配置 intent-filter
:
<activity
android:name=".activity.ConversationActivity"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden|adjustResize">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="packagename"
android:pathPrefix="/conversation/"
android:scheme="rong" />
</intent-filter>
</activity>
只使用消息中心
一节。配置普通聊天会话列表,新建 Activity ,集成 MCConversationListFragment
:
conversationListFragment = new MCConversationListFragment();
Uri uri = Uri.parse("rong://" + getApplicationInfo().packageName).buildUpon()
.appendPath("imconversationlist")
.appendQueryParameter(Conversation.ConversationType.PRIVATE.getName(), "false")
.appendQueryParameter(Conversation.ConversationType.GROUP.getName(), "false")
.appendQueryParameter(Conversation.ConversationType.SYSTEM.getName(), "true")
.appendQueryParameter(Conversation.ConversationType.PUBLIC_SERVICE.getName(), "false")
.appendQueryParameter(Conversation.ConversationType.APP_PUBLIC_SERVICE.getName(), "false")
.build();
conversationListFragment.setUri(uri);
getSupportFragmentManager().beginTransaction().add(R.id.fr_container, conversationListFragment).commitAllowingStateLoss();
配置 intent-filter
:
<activity
android:name=".activity.ConversationListActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="packagename"
android:pathPrefix="/imconversationlist"
android:scheme="rong" />
</intent-filter>
</activity>
如果有聚合会话列表的话则同理,集成 MCSubConversationListFragment
。
SDK 默认实现点击跳转,通过配置相应的 Activity 隐式启动:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="packagename"
android:pathPrefix="/conversationlist"
android:scheme="rong" />
</intent-filter>
如果想自定义 Push 和通知栏的点击事件,可以通过重写 PushMessageReceiver
:
@Override
public boolean onNotificationMessageClicked(Context context, PushNotificationMessage pushNotificationMessage) {
// 自定义跳转事件,并return true.
return true;
}
特殊情况,华为 Push 点击事件没有回调,需要通过后台配置配置华为推送时设置相应的 intent 来自定义点击事件。如果没有配置,SDK 默认实现了跳转。
消息中心消息字段都包含字段 contentUrl
,开发者可以通过在后台配置相应的 uri 启动 Web 页面或者隐式启动应用内主件,消息中心消息默认实现了跳转逻辑:
protected void performItemClick(View view, String contentUrl) {
if (!TextUtils.isEmpty(contentUrl)) {
Intent intent = new Intent();
if (contentUrl.startsWith("http") || contentUrl.startsWith("https")) {
String action = RongKitIntent.RONG_INTENT_ACTION_WEBVIEW;
intent.setAction(action);
intent.setPackage(view.getContext().getPackageName());
intent.putExtra("url", contentUrl);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
view.getContext().startActivity(intent);
} else {
// 应用内跳转
try {
if (contentUrl.endsWith("/")) {
contentUrl = contentUrl.substring(0, contentUrl.length() - 1);
}
Uri uri = Uri.parse(contentUrl);
intent.setData(uri);
intent.setPackage(view.getContext().getPackageName());
view.getContext().startActivity(intent);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
开发者如果想根据消息类型自定义实现跳转,可以通过设置消息点击事件,实现 onMessageClick
方法:
/**
* 当点击消息时执行。
*
* @param context 上下文。
* @param view 触发点击的 View。
* @param message 被点击的消息的实体信息。
* @return 如果自定义了点击后的逻辑处理,则返回 true, 否则返回 false, false 走融云默认处理方式。
*/
@Override
public boolean onMessageClick(Context context, View view, Message message) {
return false;
}
当开发者已经有一套 Push 通道,接入消息中心后,需要自行处理 Push 点击跳转事件。如果同样是通过小米华为魅族这些厂商通道,并且没有改变 Push 字段内容,则可以通过解析 Push 字段内容来构造 PushNotificationMessage
,并根据 PushNotificationMessage 来判断实现跳转和调用 RongPushClient.recordNotificationEvent
来统计 Push 点击事件:
小米 Push 、魅族 Push :
// 小米 Push 点击回调
public void onNotificationMessageClicked(Context context, MiPushMessage message) {
JSONObject json = new JSONObject(message.getContent());
pushNotificationMessage = transformToPushMessage(json);
// 根据消息中的字段处理跳转和统计 Push 打开率
RongPushClient.recordNotificationEvent(pushNotificationMessage)
...
}
// 魅族 Push 点击回调
public void onNotificationClicked(Context context, MzPushMessage mzPushMessage) {
JSONObject json = new JSONObject(message.getSelfDefineContentString());
pushNotificationMessage = transformToPushMessage(json);
// 根据消息中的字段处理跳转和统计 Push 打开率
RongPushClient.recordNotificationEvent(pushNotificationMessage)
...
}
// 解析 Push 字段
private PushNotificationMessage transformToPushMessage(JSONObject jsonObject) {
if (jsonObject == null)
return null;
PushNotificationMessage pushNotificationMessage = new PushNotificationMessage();
String channelType = jsonObject.optString("channelType");
int typeValue = 0;
if (!TextUtils.isEmpty(channelType)) {
try {
typeValue = Integer.parseInt(channelType);
} catch (NumberFormatException e) {
e.printStackTrace();
}
}
RongPushClient.ConversationType conversationType = RongPushClient.ConversationType.setValue(typeValue);
pushNotificationMessage.setConversationType(conversationType);
pushNotificationMessage.setTargetId(jsonObject.optString("fromUserId"));
pushNotificationMessage.setTargetUserName(jsonObject.optString("fromUserName"));
pushNotificationMessage.setReceivedTime(jsonObject.optLong("timeStamp"));
pushNotificationMessage.setObjectName(jsonObject.optString("objectName")); // not null
pushNotificationMessage.setSenderId(jsonObject.optString("fromUserId"));
pushNotificationMessage.setSenderName(jsonObject.optString("fromUserName"));
pushNotificationMessage.setSenderPortrait(TextUtils.isEmpty(jsonObject.optString("fromUserPo")) ? null : Uri.parse(jsonObject.optString("fromUserPo")));
pushNotificationMessage.setPushTitle(jsonObject.optString("title"));
pushNotificationMessage.setPushContent(jsonObject.optString("content"));
pushNotificationMessage.setPushData(jsonObject.optString("appData"));
pushNotificationMessage.setPushFlag("true");
String toId = "";
PushNotificationMessage.PushSourceType sourceType = PushNotificationMessage.PushSourceType.FROM_OFFLINE_MESSAGE;
try {
JSONObject temp = jsonObject.optJSONObject("rc");
if (temp == null) {
String rcjson = jsonObject.optString("rc");
if (rcjson != null) {
temp = new JSONObject(rcjson);
}
}
toId = temp.optString("tId");
String type = temp.optString("sourceType");
if (!TextUtils.isEmpty(type)) {
sourceType = PushNotificationMessage.PushSourceType.values()[Integer.parseInt(type)];
}
pushNotificationMessage.setToId(toId); //not null
pushNotificationMessage.setSourceType(sourceType); // not null
pushNotificationMessage.setPushId(temp.optString("id")); // not null
if (temp.has("ext") && temp.getJSONObject("ext") != null) {
pushNotificationMessage.setExtra(temp.getJSONObject("ext").toString());
}
} catch (JSONException e) {
e.printStackTrace();
}
return pushNotificationMessage;
}
由于华为 Push 没有点击事件回调,需要在调用华为发送推送的时候配置相应的 intent ,根据该 intent 启动相应的 Activity ,启动后需要调用 RongPushClient
相应的接口统计 Push 打开率:
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_message_center);
Intent intent = getIntent();
if (intent != null && intent.getData() != null && intent.getData().getScheme() != null
&& intent.getData().getScheme().equals("rong") && intent.getData().getQueryParameter("isFromPush") != null
&& intent.getData().getQueryParameter("isFromPush").equals("true")) {
// 统计华为 Push 点击事件,调动该接口用于后台统计 Push 打开率
RongPushClient.recordHWNotificationEvent(intent);
}
}
IM SDK
的前提下,也就是初始化成功并且成功连接了融云服务。根据预先设置的业务触发事件由系统自动发送的消息。
本文档以通知升级消息为例,描述触发类消息的实现流程。
场景描述:
当用户 A 满足“连续 7 天登录“条件后,系统将用户 A 的等级信息从“初级”改为“高级”,并自动向此用户发送一条“通知升级消息”。
通知升级消息相关参数:
RC:ML:Official:Upgrade
{
"imageUrl": "https://rongcloud-res.cn.ronghub.com/fc269b9ba6dfc08b2853966c14227fa6",
"content": "恭喜你成功完成(新手登录任务)获得奖励,快去领取吧!",
"contentUrl": "http://www.rongcloud.cn",
"buttonTitle": "",
"extra": ""
}
pushContent: 恭喜你成功完成(新手登录任务)获得奖励,快去领取吧!
消息在客户端的展示效果如下:
服务端:
需要提供一个升级接口,使得客户端登录的用户在满足升级条件后,可以调用这个接口向服务端发出请求,修改客户等级。
接口配置:
HTTP方法: POST
HTTP URL: /user/upgrade
Query参数: 无
Header参数: 登录成功时返回的cookie
HTTP响应: 正常响应,返回 "code": 1000
客户端:
需要将消息中心库导入工程,注册消息:
#import "RCMLOfficialUpgrade.h"
[[RCIM sharedRCIM] registerMessageType:[RCMLOfficialUpgrade class]];
触发条件: 当用户 A 连续 7 天登录。
调用接口: 当用户 A 连续 7 天登录,客户端通过 HTTP 请求的方式,调用升级接口(/user/upgrade),如果返回 1000,表示请求成功。如果返回非 1000,可以使用 HTTP 抓包工具进行调试。
接口响应: 当客户端调用升级接口(/user/upgrade)时,服务端修改数据库中用户 A 的等级信息,即:从“初级”改为“高级”。 成功后,HTTP 响应客户端的请求,返回 1000,并构造“通知升级消息(RC:ML:Official:Upgrade)”,发送给用户 A。
名称 | 标识 | 描述 | 样式 |
---|---|---|---|
OrderProcessing | RC:ML:Trading:OrderProcessing | 预定处理中通知 | 纯文本 |
OrderFailed | RC:ML:Trading:OrderFailed | 预定失败通知 | 纯文本 |
OrderSuccess | RC:ML:Trading: OrderSuccess | 预定成功通知 | 纯文本 |
NotPaid | RC:ML:Trading:NotPaid | 预定未付款通知 | 纯文本 |
Paid | RC:ML:Trading:Paid | 预定已付款通知 | 纯文本 |
OrderDistribution | RC:ML:Trading:OrderDistribution | 订单开始配送通知 | 纯文本 |
OrderComment | RC:ML:Trading:Comment | 订单完成待评论通知 | 纯文本 |
名称 | 标识 | 描述 | 样式 |
---|---|---|---|
Upgrade | RC:ML:Official:Upgrade | 通知升级 | 纯文本 |
DiscountsExpire | RC:ML:Official:DiscountsExpire | 优惠到期提醒 | 纯文本 |
WelcomeTxt | RC:ML:Official:Welcome:Txt | 欢迎消息 | 纯文本 |
WelcomeImgTxt | RC:ML:Official:Welcome:ImgTxt | 欢迎消息 | 图文 |
名称 | 标识 | 描述 | 样式 |
---|---|---|---|
Comment | RC:ML:Interaction:Comment | 评论消息 | 方形图标卡片 |
Liked | RC:ML:Interaction: Liked | 点赞消息 | 方形图标卡片 |
Followed | RC:ML:Interaction:Followed | 关注消息 | 方形图标卡片 |
Awaken | RC:ML:Interaction:Awaken | 唤醒消息 | 方形图标卡片 |
名称 | 标识 | 描述 | 样式 |
---|---|---|---|
HelpInfo | RC:ML:Community:HelpInfo | 求助信息通知 | 方形图标卡片 |
买家提交订单完成后,卖家确认订单时发送的消息
属性 | 类型 | 描述 |
---|---|---|
content | string | 消息内容 |
contentUrl | string | 点击消息内容跳转的 Url 地址 |
extra | string | 附加信息 |
示例
objectName:
RC:ML:Trading:OrderProcessing
content:{
"content": "预定处理中:代理小哥正在确认你的订单【佳洁士牙膏,新年红包套装...】,请耐心等候....",
"contentUrl": "http://www.rongcloud.cn",
"extra": ""
}
pushContent:
预定处理中:代理小哥正在确认你的订单【佳洁士牙膏,新年红包套装...】,请耐心等候....
买家提交订单完成后,订单生成失败时发送的消息
属性 | 类型 | 描述 |
---|---|---|
content | string | 消息内容 |
contentUrl | string | 点击消息内容跳转的 Url 地址 |
extra | string | 附加信息 |
示例
objectName:
RC:ML:Trading:OrderFailed
content:{
"content": "由于【SHOP】太火爆了,预定未成功,更多选择等你查看。",
"contentUrl": "http://www.rongcloud.cn",
"extra": ""
}
pushContent:
预定失败:由于【SHOP】太火爆了,预定未成功,更多选择等你查看。
买家提交订单完成后,订单生成成功时发送的消息
属性 | 类型 | 描述 |
---|---|---|
content | string | 消息内容 |
contentUrl | string | 点击消息内容跳转的 Url 地址 |
extra | string | 附加信息 |
示例
objectName:
RC:ML:Trading:OrderSuccess
content:{
"content": "预定成功:你预定【SHOP】已进行订单确认,欢迎光临下榻。",
"contentUrl": "http://www.rongcloud.cn",
"extra": ""
}
pushContent:
预定成功:你预定【SHOP】已进行订单确认,欢迎光临下榻。
订单生成成功后,买家未付款时发送的消息
属性 | 类型 | 描述 |
---|---|---|
content | string | 消息内容 |
contentUrl | string | 点击消息内容跳转的 Url 地址 |
extra | string | 附加信息 |
示例
objectName:
RC:ML:Trading:NotPaid
content:{
"content": "你的订单【佳洁士牙膏...】,还未付款,就差一步,就能拥有它......",
"contentUrl": "http://www.rongcloud.cn",
"extra": ""
}
pushContent:
你的订单【佳洁士牙膏...】,还未付款,就差一步,就能拥有它......
订单生成成功后,买家已付款时发送的消息
属性 | 类型 | 描述 |
---|---|---|
content | string | 消息内容 |
contentUrl | string | 点击消息内容跳转的 Url 地址 |
extra | string | 附加信息 |
示例
objectName:
RC:ML:Trading:Paid
content:{
"content": "你的订单【佳洁士牙膏...】,已付款,商家开始备货,准备出库.......",
"contentUrl": "http://www.rongcloud.cn",
"extra": ""
}
pushContent:
你的订单【佳洁士牙膏...】,已付款,商家开始备货,准备出库.......
订单付款成功后,卖家发货并开始配送时发送的消息
属性 | 类型 | 描述 |
---|---|---|
content | string | 消息内容 |
contentUrl | string | 点击消息内容跳转的 Url 地址 |
extra | string | 附加信息 |
示例
objectName:
RC:ML:Trading:OrderDistribution
content:{
"content": "你的订单【佳洁士牙膏...】,已经开始配送,请不要走开。配送员:小马 电话:1371759800",
"contentUrl": "http://www.rongcloud.cn",
"extra": ""
}
pushContent:
你的订单【佳洁士牙膏...】,已经开始配送,请不要走开。配送员:小马 电话:1371759800
订单商品送达买家后,提示买家给出评价时发送的消息
属性 | 类型 | 描述 |
---|---|---|
content | string | 消息内容 |
contentUrl | string | 点击消息内容跳转的 Url 地址 |
extra | string | 附加信息 |
示例
objectName:
RC:ML:Trading:Comment
content:{
"content": "订单【SHOP】已完成,期待反馈和评论。",
"contentUrl": "http://www.rongcloud.cn",
"extra": ""
}
pushContent:
订单【SHOP】已完成,期待反馈和评论。
当用户完成新手登录任务后,发送的消息,用户可以通过点击消息中的按钮,领取奖励。
属性 | 类型 | 描述 |
---|---|---|
content | string | 消息内容 |
contentUrl | string | 点击消息内容跳转的 Url 地址 |
imageUrl | string | 消息中图片的 Url 地址 |
buttonTitle | string | 按钮的标题 |
extra | string | 附加信息 |
示例
objectName:
RC:ML:Official:Upgrade
content:{
"content": "恭喜你成功完成(新手登录任务)获得奖励,快去领取吧!",
"contentUrl": "http://www.rongcloud.cn",
"imageUrl":"https://rongcloud-res.cn.ronghub.com/fc269b9ba6dfc08b2853966c14227fa6",
"buttonTitle": "立即领取",
"extra": ""
}
pushContent:
恭喜你成功完成(新手登录任务)获得奖励,快去领取吧!
优惠券即将到期时,提示用户领取时发送的消息
属性 | 类型 | 描述 |
---|---|---|
content | string | 消息内容 |
contentUrl | string | 点击消息内容跳转的 Url 地址 |
imageUrl | string | 消息中图片的 Url 地址 |
contentTitle | string | 内容的标题 |
extra | string | 附加信息 |
示例
objectName:
RC:ML:Official: DiscountsExpire
content:{
"content": "你有一张 50.00 优惠券明日到期,再不领取就要过期啦!",
"contentUrl": "http://www.rongcloud.cn",
"imageUrl": "",
"contentTitle": "优惠到期提醒",
"extra": ""
}
pushContent:
优惠到期提醒
用户安装应用后,发送的纯文本类型的欢迎消息
属性 | 类型 | 描述 |
---|---|---|
content | string | 消息内容 |
contentUrl | string | 点击消息内容跳转的 Url 地址 |
extra | string | 附加信息 |
示例
objectName:
RC:ML:Official:Welcome:Txt
content:{
"content": "你好, Alice:\n\n很高兴认识你。蜜糖直播帮你结交新朋友,也时刻保护你的隐私安全。\n了解《蜜糖直播平台行为规范》,和我们一期健康成长,发现更多奇幻世界。",
"contentUrl": "http://www.rongcloud.cn",
"extra": ""
}
pushContent:
你好,Alice:很高兴认识你。
用户安装应用后,发送的图文类型的欢迎消息
属性 | 类型 | 描述 |
---|---|---|
content | string | 消息内容 |
contentUrl | string | 点击消息内容跳转的 Url 地址 |
imageUrl | string | 消息中图片的 Url 地址 |
welcomeTitle | string | 欢迎的标题 |
extra | string | 附加信息 |
示例
objectName:
RC:ML:Official:Welcome:ImgTxt
content:{
"content": "你好, Alice:\n\n很高兴认识你。蜜糖直播帮你结交新朋友,也时刻保护你的隐私安全。\n了解《蜜糖直播平台行为规范》,和我们一期健康成长,发现更多奇幻世界。",
"contentUrl": "http://www.rongcloud.cn",
"imageUrl": "https://rongcloud-res.cn.ronghub.com/8793820294a993d57365a7f9d9b91d2e",
"welcomeTitle": "终于等到你",
"extra": ""
}
pushContent:
你好,Alice:很高兴认识你。
发布的内容被其他用户评论后,发送的消息
属性 | 类型 | 描述 |
---|---|---|
opreatorId | string | 操作者的 userId |
opreatorName | string | 操作者的昵称 |
opreatorPortraitUrl | string | 操作者头像的 Url 地址 |
countUrl | string | 点击消息内容跳转的 Url 地址 |
extra | string | 附加信息 |
示例
objectName:
RC:ML:Interaction:Comment
content:{
"opreatorId": "opreator1",
"opreatorName": "莫莫酱",
"opreatorPortraitUrl": "https://rongcloud-res.cn.ronghub.com/1d7c39378bb561d8783798e19e0ee373",
"countUrl": "http://www.rongcloud.cn",
"extra": ""
}
pushContent:
莫莫酱刚刚发表了评论@了你
发布的内容被其他用户点赞后,发送的消息
属性 | 类型 | 描述 |
---|---|---|
opreatorId | string | 操作者的 userId |
opreatorName | string | 操作者的昵称 |
opreatorPortraitUrl | string | 操作者头像的 Url 地址 |
countUrl | string | 点击消息内容跳转的 Url 地址 |
extra | string | 附加信息 |
示例
objectName:
RC:ML:Interaction:Liked
content:{
"opreatorId": "opreator2",
"opreatorName": "小胖",
"opreatorPortraitUrl": "https://rongcloud-res.cn.ronghub.com/70cb59b054e5e7587ea1750adf074849",
"countUrl": "http://www.rongcloud.cn",
"extra": ""
}
pushContent:
小胖刚刚为你点赞
被其他用户关注后,发送的消息
属性 | 类型 | 描述 |
---|---|---|
opreatorId | string | 操作者的 userId |
opreatorName | string | 操作者的昵称 |
opreatorPortraitUrl | string | 操作者头像的 Url 地址 |
countUrl | string | 点击消息内容跳转的 Url 地址 |
extra | string | 附加信息 |
示例
objectName:
RC:ML:Interaction:Followed
content:{
"opreatorId": "opreator2",
"opreatorName": "小胖",
"opreatorPortraitUrl": "https://rongcloud-res.cn.ronghub.com/70cb59b054e5e7587ea1750adf074849",
"countUrl": "http://www.rongcloud.cn",
"extra": ""
}
pushContent:
小胖刚刚关注了你
被其他用户唤醒后,发送的消息
属性 | 类型 | 描述 |
---|---|---|
opreatorId | string | 操作者的 userId |
opreatorName | string | 操作者的昵称 |
opreatorPortraitUrl | string | 操作者头像的 Url 地址 |
countUrl | string | 点击消息内容跳转的 Url 地址 |
count | string | 消息内容 |
extra | string | 附加信息 |
示例
objectName:
RC:ML:Interaction:Awaken
content:{
"opreatorId": "opreator1",
"opreatorName": "莫莫酱",
"opreatorPortraitUrl": "https://rongcloud-res.cn.ronghub.com/1d7c39378bb561d8783798e19e0ee373",
"countUrl": "http://www.rongcloud.cn",
"count": "你再不出现 ,莫莫酱就要生气了哦 ~ 呜呜",
"extra": ""
}
pushContent:
你再不出现 ,莫莫酱就要生气了哦 ~ 呜呜
被其他用户求助时,发送的消息
属性 | 类型 | 描述 |
---|---|---|
opreatorId | string | 操作者的 userId |
opreatorName | string | 操作者的昵称 |
opreatorPortraitUrl | string | 操作者头像的 Url 地址 |
countUrl | string | 点击消息内容跳转的 Url 地址 |
count | string | 消息内容 |
extra | string | 附加信息 |
示例
objectName:
RC:ML:Community:HelpInfo
content:{
"opreatorId": "opreator2",
"opreatorName": "小胖",
"opreatorPortraitUrl": "https://rongcloud-res.cn.ronghub.com/70cb59b054e5e7587ea1750adf074849",
"countUrl": "http://www.rongcloud.cn",
"count": "有个问题向你求助:小唐山 有停车位吗?",
"extra": ""
}
pushContent:
有个问题向你求助:小唐山 有停车位吗?
详细查看消息中心支持的投放类消息说明
由运营人员通过管理后台,手动投放的各类用于营销的消息。
运营人员初次使用管理后台时,需要对消息分类进行参数配置。
说明:设置的分类将在投放操作界面的“消息分类”列表中展现,供投放操作时进行选择。
消息素材是最终到达用户消息中心中的消息。在消息中心管理后台有多种样式的模板可供选择,模板的种类还会根据需求不断增加,可以通过点击这里提交需求。
消息投放是进行最终投放参数、目标和内容设置的环节。
根据实际需要对投放参数、目标和内容进行设置:
投放名称:不会显示给用户,只是用来对投放进行标识,便于后续查看检索。
客户端展示方式:
推送通知 + 消息:是指投放的消息会在移动端消息中心保存并展示。如果消息投放时,用户没有打开 App 会同时推送一条通知。
仅展示推送通知:只投放一条通知,点击跳转指定页面,移动端消息中心不会出现新的消息。
点击【保存】,当前编辑的投放会保存在投放列表中。点击【执行投放】可预览投放信息,并选择【立即投放】或【定时投放】。