代码拉取完成,页面将自动刷新
package io.rong.example.chatroom;
import io.rong.CenterEnum;
import io.rong.RongCloud;
import io.rong.methods.chatroom.keepalive.Keepalive;
import io.rong.models.chatroom.ChatroomModel;
import io.rong.models.response.ChatroomKeepaliveResult;
import io.rong.models.response.ResponseResult;
/**
*
* Example for Chatroom Keepalive
* @author RongCloud
*
* @version 3.0.0
*/
public class KeepaliveExample {
/**
* Replace with your App Key
* */
private static final String appKey = "appKey";
/**
* Replace with your App Secret
* */
private static final String appSecret = "appSecret";
public static void main(String[] args) throws Exception {
RongCloud rongCloud = RongCloud.getInstance(appKey, appSecret, CenterEnum.BJ);
//Custom API URL
//RongCloud rongCloud = RongCloud.getInstance(appKey, appSecret,api);
Keepalive keepalive = rongCloud.chatroom.keepalive;
/**
*
*
* Add a keepalive chatroom
*
**/
ChatroomModel chatroom = new ChatroomModel()
.setId("d7ec7a8b8d8546c98b0973417209a548");
ResponseResult addResult = keepalive.add(chatroom);
System.out.println("add keepalive result"+addResult.toString());
/**
*
*
* Remove a keepalive chatroom
*
**/
ResponseResult removeResult = keepalive.remove(chatroom);
System.out.println("keepalive remove"+removeResult.toString());
/**
*
*
*
* Retrieve Keepalive Chatroom
*
**/
ChatroomKeepaliveResult result = keepalive.getList();
System.out.println("keepalive getList"+result.toString());
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。