Group message

5.1 Implement the callback function

Receiving the group message through a callback function passed in during the login process;

function starRtcLoginCallBack(data,status) {
switch (status){
...
case "onGroupMessage":
//Receive group message
break;
case "onGroupPrivateMessage":
//Receive private group messages
break;
case "onGroupPushMessage":
//Receive group push message
break;
case "onSystemPushMessage":
//Received a system private message
break;
case "onPushGroupSystemMsgFin":
//Receive the feedback from the push group system message to the specified group
break;
case "onPushSystemMsgFin":
//Receive push system messages to specified users
break;
case "onUnsetGroupMsgIgnoreFin":
//Receive the feedback of requesting to turn off group do not disturb
break;
case "onSetGroupMsgIgnoreFin":
//Receive the feedback of requesting to turn on group do not disturb
break;
case "onRemoveGroupUserFin":
//Receive the feedback of requesting to delete a group member
break;
case "onAddGroupUserFin":
//Receive the feedback of requesting to add a group member
break;
case "onDelGroupFin":
//Receive the feedback of requesting to delete the group
break;
case "onCreateGroupFin":
//Receive the feedback of requesting to create the group
break;
case "onSendGroupMsgFin":
//Receive the feedback of requesting to send the group message
break;
}
};

//Login to the SDK
var starSDK = new StarRtc.StarSDK();
starSDK.login(appID,userId,authKey,callBack);

5.2 Send the group message

/**
* Send the group message
* @param _targetGroupId group ID
* @param _digest digest
* @param _txt text
*/
StarRtc.StarSDK.sendGroupMsg = function(_targetGroupId,_digest,_txt)

/**
* Set group DND
* @param ignore trueSet group DNDfalseUnset group DND
*/
StarRtc.StarSDK.setGroupMsgPush = function (ignore)

/**
* Delete the group member
* @param groupId group ID
* @param removeUsers The Users to be removedand the data type is array.
*/
StarRtc.StarSDK.removeGroupUsers = function (groupId, removeUsers)

/**
* Add group members
* @param groupId group ID
* @param addUsers The Users to be removedand the data type is array.
* @param userDefineData
*/
StarRtc.StarSDK.addGroupUsers = function (groupId, addUsers, userDefineData)

/**
* Delete the group
* @param groupId group ID
*/
StarRtc.StarSDK.delGroup = function (groupId)

/**
* Create the group
* @param addUsers The Users to be addedand the data type is array.
* @param userDefineData
*/
StarRtc.StarSDK.createGroup = function (addUsers, userDefineData)