群组
5.1 获取XHGroupManager实例,添加群组事件监听
示例:
XHGroupManager groupManager = XHClient.getInstance().getGroupManager(); groupManager.addListener(new IXHGroupManagerListener() { @Override public void onMembersUpdeted(String groupID, int number) { }
@Override public void onSelfKicked(String groupID) { }
@Override public void onGroupDeleted(String groupID) { }
@Override public void onReceivedMessage(XHIMMessage message) { } });
|
5.2 XHGroupManager API 说明
void addListener(IXHGroupManagerListener groupManagerListener);
void createGroup(String groupName,IXHResultCallback callback);
void deleteGroup(String groupID,IXHResultCallback callback);
void addGroupMembers(String groupID, ArrayList<String> memberIDs, IXHResultCallback callback);
void deleteGroupMembers(String groupID,ArrayList<String> memberIDs, IXHResultCallback callback);
void setPushEnable(String groupID,Boolean enable,IXHResultCallback callback);
XHIMMessage sendMessage(String groupID, ArrayList<String> atUserIDs, String Message, IXHResultCallback callback);
XHIMMessage sendOnlineMessage(String groupID, ArrayList<String> atUserIDs, String Message, IXHResultCallback callback);
|