# All chat room messages
# Notice message event
public void onNotifyNotice(JSONObject data) { // Notice event
Log.d("message", data);
}
1
2
3
2
3
Push result value
Value Identifier Description roomId String Channel Key issued after joining CMS nickName String Nickname of the user entering the chatroom clientKey String Connected terminal setting unique key that sent the message message Date Message sent mimeType String Message type (text: plain text, emoji: emoji) messageType String In case of empty value, general message, in case of notice: "notice" messageDt String Sent Date messageCount String Number of chat room messages sent grade String Rating of the user who sent the message ( Check user level table
)
# code to apply to the project
public void onNotifyNotice(JSONObject data) { // Notice event
Message msg = new Message(data);
msg.setType("notice");
messageExposure(msg, false);
}
1
2
3
4
5
6
2
3
4
5
6
# New user connection event
public void onNotifyJoinUser(JSONObject data) { // join event
Log.d("message", data);
}
1
2
3
2
3
Push result value
Value Identifier Description roomId String Channel Key issued after joining CMS nickName String Nickname of the user entering the chatroom clientKey String Connected terminal setting unique key that sent the message joinCount String Accumulated number of users grade String Rating of the user who sent the message ( check user level table
)
# code to apply to the project
public void onNotifyJoinUser(JSONObject data) { // join event
Message msg = new Message(data);
if (!nick_name.equalsIgnoreCase(msg.getNickName())) {
msg.setType("join");
msg.setMessage(msg.getNickName() + " has entered.");
messageExposure(msg, false);
}
}
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
# Event when a user leaves
public void onNotifyLeaveUser(JSONObject data) { // disconnect event
Log.d("message", data);
}
1
2
3
2
3
Push result value
Value Identifier Description nickName String Nickname of the user entering the chatroom
# code to apply to the project
public void onNotifyLeaveUser(JSONObject data) { // disconnect event
Message msg = new Message(data);
msg.setType("leave");
msg.setMessage(msg.getNickName() + " has left.");
messageExposure(msg, false);
}
1
2
3
4
5
6
2
3
4
5
6
# Banish event from chat room
public void onNotifyKickUser(JSONObject data) { // kick event
Log.d("message", data);
}
1
2
3
2
3
Push result value
Value Identifier Description nickName String Nickname of the user entering the chatroom
# code to apply to the project
public void onNotifyKickUser(JSONObject data) { // kick event
Message msg = new Message(data);
msg. setType("kick");
messageExposure(msg, false);
}
1
2
3
4
5
6
2
3
4
5
6
# Banish release event in chat room
public void onNotifyUnkickUser(JSONObject data) { // Unkick event
Log.d("message", data);
}
1
2
3
2
3
Push result value
Value Identifier Description clientKey String Connected terminal setting unique key that sent the message messageDt String Sent Date
# code to apply to the project
public void onNotifyUnkickUser(JSONObject data) { // Unkick event
Message msg = new Message(data);
msg.setType("unKick");
messageExposure(msg, false);
}
1
2
3
4
5
6
2
3
4
5
6
# Posting limit event in chat room
public void onNotifyMuteUser(JSONObject data) { // mute event
Log.d("message", data);
}
1
2
3
2
3
Push result value
Value Identifier Description nickName String Nickname of the user entering the chatroom clientKey String Connected terminal setting unique key that sent the message messageDt String Sent Date
# code to apply to the project
public void onNotifyMuteUser(JSONObject data) { // mute event
Message msg = new Message(data);
msg.setType("mute");
messageExposure(msg, false);
}
1
2
3
4
5
6
2
3
4
5
6
# Event to unlock writing in the chat room
public void onNotifyUnmuteUser(JSONObject data) { // unmute event
Log.d("message", data);
}
1
2
3
2
3
Push result value
Value Identifier Description nickName String Nickname of the user entering the chatroom clientKey String Connected terminal setting unique key that sent the message messageDt String Sent Date
# code to apply to the project
public void onNotifyUnmuteUser(JSONObject data) { // unmute event
Message msg = new Message(data);
msg.setType("unMute");
messageExposure(msg, false);
}
1
2
3
4
5
6
2
3
4
5
6
# full code
message event full code
channel.setHandler(new MessageHandler() {
public void onNotifyNotice(JSONObject data) { // Notice event
Message msg = new Message(data);
msg.setType("notice");
messageExposure(msg, false);
}
public void onNotifyJoinUser(JSONObject data) { // join event
Message msg = new Message(data);
if (!nick_name.equalsIgnoreCase(msg.getNickName())) {
msg.setType("join");
msg.setMessage(msg.getNickName() + " has entered.");
messageExposure(msg, false);
}
}
public void onNotifyLeaveUser(JSONObject data) { // disconnect event
Message msg = new Message(data);
msg.setType("leave");
msg.setMessage(msg.getNickName() + " has left.");
messageExposure(msg, false);
}
public void onNotifyKickUser(JSONObject data) { // kick event
Message msg = new Message(data);
msg. setType("kick");
messageExposure(msg, false);
}
public void onNotifyUnkickUser(JSONObject data) { // Unkick event
Message msg = new Message(data);
msg.setType("unKick");
messageExposure(msg, false);
}
public void onNotifyMuteUser(JSONObject data) { // mute event
Message msg = new Message(data);
msg.setType("mute");
messageExposure(msg, false);
}
public void onNotifyUnmuteUser(JSONObject data) { // unmute event
Message msg = new Message(data);
msg.setType("unMute");
messageExposure(msg, false);
}
});
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
49
50
51
52
53
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
49
50
51
52
53