Browse SDKs · iOS
SDKsiOS

Check friendship status

Check the friendship status of specified users with OpenIM iOS SDK.

Copy
[[OIMManager manager] checkFriend:@[@"user_a", @"user_b"]
                        onSuccess:^(NSArray<OIMSimpleResultInfo *> *results) {
                            [relationshipStore mergeResults:results];
                        }
                        onFailure:nil];

Pass an array of user IDs to check. Each OIMSimpleResultInfo in the success callback identifies its target by userID. A result value of 1 means that the target is a friend and is not blocked. Do not infer additional states that are not declared by the pinned SDK.

This method only retrieves a relationship snapshot and does not trigger a friendship delegate. To retrieve friend remarks, avatars, or extension fields, use getSpecifiedFriendsInfo:filterBlack:onSuccess:onFailure:.