闲着没事,用了两天的时间集成了一下环信,git 地址:https://gitee.com/zhangxiny/HuanXin.git
环信 API 总体来说写的很清晰,集成中遇到的坑就是在添加群成员后,通过获取群所有成员的 api,只有群主的是获取全部成员,其他成员通过这个 api 是获取不到自己的
最后我连着调用两次才可以都获取到,
EMError *error = nil;
EMCursorResult* result = [[EMClient sharedClient].groupManager getGroupMemberListFromServerWithId:self.conversation.conversationId cursor:@"" pageSize:50 error:&error];
EMError *error1 = nil;
EMGroup * group = [[EMClient sharedClient].groupManager getGroupSpecificationFromServerWithId:self.conversation.conversationId error:&error1];
如果别的做法的欢迎交流 QQ:260697008
如果有时间,我会用设计模式重新架构一下项目