注册

iOS环信添加好友问题

IOS 添加好友时,有没有方法进行判断该好友ID是否存在于此环信中,或者有没有方法获得此环信中的所有好友列表

好友问题.png

已邀请:
/*!

 *  \~chinese

 *  从服务器获取所有的好友

 *

 *  同步方法,会阻塞当前线程

 *

 *  @param pError 错误信息

 *

 *  @Return 好友列表<NSString>

 *

 *  \~english

 *  Get all the friends from the server

 *

 *  Synchronization method will block the current thread

 *

 *  @param pError Error

 *

 *  @Return Contact list<NSString>

 */

- (NSArray *)getContactsFromServerWithError:(EMError **)pError;-------这是3.x SDK获取好友列表的方法
 
/*!

 @Method

 @brief 手动获取好友列表(异步方法)

 @discussion

 @param completion 获取好友列表完成后的回调

 @param queue      completion block 回调时的线程

 */

- (void *)asyncFetchBuddyListWithCompletion:(void (^)(NSArray *buddyList, EMError *error))completion

                                    onQueue:(dispatch_queue_t)queue;-------这个是2.0 的SDK获取好友列表的方法
 
可以获取好友列表再去比对

要回复问题请先登录注册