-
Notifications
You must be signed in to change notification settings - Fork 220
Expand file tree
/
Copy pathDistributeExample.java
More file actions
48 lines (38 loc) · 1.39 KB
/
DistributeExample.java
File metadata and controls
48 lines (38 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package io.rong.example.chatroom;
import io.rong.CenterEnum;
import io.rong.RongCloud;
import io.rong.methods.chatroom.distribute.Distribute;
import io.rong.models.chatroom.ChatroomModel;
import io.rong.models.response.ResponseResult;
public class DistributeExample {
/**
* 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);
Distribute distribute = rongCloud.chatroom.distribute;
/**
*
*
* Stop Chatroom Message Distribution
*/
ChatroomModel chatroomModel = new ChatroomModel()
.setId("d7ec7a8b8d8546c98b0973417209a548");
ResponseResult result = distribute.stop(chatroomModel);
System.out.println("stopDistributionMessage: " + result.toString());
/**
*
*
* Resume Chatroom Message Distribution
*/
ResponseResult resumeResult = distribute.resume(chatroomModel);
System.out.println("resumeDistributionMessage: " + resumeResult.toString());
}
}