代码拉取完成,页面将自动刷新
package io.rong.example.chatroom;
import io.rong.CenterEnum;
import io.rong.RongCloud;
import io.rong.methods.chatroom.demotion.Demotion;
import io.rong.models.response.ChatroomDemotionMsgResult;
import io.rong.models.response.ResponseResult;
public class DemotionExample {
/**
* Replace with your appKey
*/
private static final String appKey = "appKey";
/**
* Replace with your appSecret
*/
private static final String appSecret = "appSecret";
public static void main(String[] args) throws Exception {
RongCloud rongCloud = RongCloud.getInstance(appKey, appSecret, CenterEnum.BJ);
Demotion demotion = rongCloud.chatroom.demotion;
/**
*
* Add in-app chatroom message demotion
*/
String[] messageType = {"RC:VcMsg", "RC:ImgTextMsg", "RC:ImgMsg"};
ResponseResult addResult = demotion.add(messageType);
System.out.println("add demotion: " + addResult.toString());
/**
*
* Remove in-app chatroom message demotion
*/
ResponseResult removeResult = demotion.remove(messageType);
System.out.println("remove demotion: " + removeResult.toString());
/**
* Retrieves the list of demotion messages and prints the result.
*/
ChatroomDemotionMsgResult demotionMsgResult = demotion.getList();
System.out.println("get demotion: " + demotionMsgResult.toString());
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。