addGroupListener
Introduction
Add a group listener.
This method could add a new group listener, for the changes of group infos, to the array of listeners.
Parameter details
Parameter name | Parameter type | Required | Description |
---|---|---|---|
listener | V2TimGroupListener | yes | The group listener. |
Returned template
void
Return value details
This function has no return value
Code example
import { TencentImSDKPlugin } from 'react-native-tim-js';
const groupListener = {
onMemberEnter: (groupID, memberList) => {
},
onMemberLeave: (groupID, member) => {
},
onMemberInvited: (groupID, opUser, memberList) => {
},
onMemberKicked: (groupID, opUser, memberList) => {
},
onMemberInfoChanged: (groupID, groupMemberChangeInfoList) => {
},
onGroupCreated: (groupID) => {
},
onGroupDismissed: (groupID, opUser) => {
},
onGroupRecycled: (groupID, opUser) => {
},
onGroupInfoChanged: (groupID, changeInfos) => {
},
onReceiveJoinApplication: (groupID, member, opReason) => {
},
onApplicationProcessed: (groupID, opUser, isAgreeJoin, opReason) => {
},
onGrantAdministrator: (groupID, opUser, memberList) => {
},
onRevokeAdministrator: (groupID, opUser, memberList) => {
},
onQuitFromGroup: (groupID) => {
},
onReceiveRESTCustomData: (groupID, customData) => {
},
onGroupAttributeChanged: (groupID, groupAttribute) => {
},
onGroupCounterChanged: (groupID: string, key: string, newValue: number) => {
}
};
TencentImSDKPlugin.v2TIMManager.addGroupListener(groupListener);