Skip to main content

getUsersInfo

Feature Description

Description

Retrieve nicknames and avatars in IM.

Note

(1) It's recommended to request a maximum of 100 at a time as a larger number might result in the backend rejecting the request due to the data packet being too large; (2) Data is primarily fetched from the server. If that fails, it is then retrieved from local cache; (3) When users use this interface to get the personal information of non-friends, the SDK will internally update this cache.

Function Prototype


- (void)getUsersInfo:(NSArray<NSString *> *)userIDs
onSuccess:(nullable OIMPublicUsersInfoCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;

Input Parameters

Parameter NameData TypeMandatoryDescription
userIDsNSArray<NSString *>YesList of user IDs
groupIDNSStringNoGroup ID

Return Value

Parameter NameData TypeDescription
onSuccessOIMPublicUserInfoSuccessful
onFailureOIMFailureCallbackFailure

Code Example


[OIMManager.manager getUsersInfoWithCache:@[]
groupID:@""
onSuccess:^(NSArray<OIMUserInfo *> * _Nullable usersInfo) {

} onFailure:^(NSInteger code, NSString * _Nullable msg) {

}];