群组消息
4.1 群组对象创建
创建CGroupManager对象,传入用户配置信息
添加群组回调函数指针
添加获取群组列表回调函数指针
对象所属类需要实现IGroupManagerListener接口和IGroupGetListListener接口 m_pGroupManager = new XHGroupManager(this); XHGroupManager::addGroupGetListListener(this);
|
4.2 获取群组列表说明
无AEC使用方法
static void getGroupList(CUserManager* pUserManager) { XHGroupManager::getGroupList(); } 调用该方法后会相应applyGetGroupListFin回调函数
static void getUserList(CUserManager* pUserManager, string strGroupId) { XHGroupManager::getUserList(strGroupId); } 调用该方法后会相应applyGetUserListFin回调函数
|
AEC使用方法
void getGroupList(CUserManager* pUserManager) { list<CGroupInfo> groupInfoList; CInterfaceUrls::demoQueryImGroupList(m_pUserManager->m_ServiceParam.m_strUserId,groupInfoList); applyGetGroupListFin(groupInfoList); }
void getUserList(CUserManager* pUserManager, string strGroupId) { CGroupMemoryInfo userList; CInterfaceUrls::demoQueryImGroupInfo(m_pUserManager->m_ServiceParam.m_strUserId, strGroupId, userList); applyGetUserListFin(userList); }
|
4.3 XHGroupManager API 说明
static void addGroupGetListListener(IGroupGetListListener* pGroupGetListListener);
static void getGroupList();
static void getUserList(string strGroupId);
string createGroup(string groupName);
bool deleteGroup(string groupID);
void addGroupMembers(string groupID, list<string> memberIDs);
void deleteGroupMembers(string groupID, list<string> memberIDs);
void setPushEnable(string groupID, bool enable);
CIMMessage* sendMessage(string groupID, list<string> atUserIDs, string Message);
CIMMessage* sendOnlineMessage(string groupID, list<string> atUserIDs, string Message);
|