Browse SDKs · iOS
Platform
SDKsiOS

Retrieve your profile

Retrieve the signed-in user’s profile with OpenIM iOS SDK.

Copy

Retrieve the full profile snapshot for the currently signed-in user using getSelfInfoWithOnSuccess:onFailure:. This method requires no arguments.

Code example

[[OIMManager manager] getSelfInfoWithOnSuccess:^(OIMUserInfo *user) {
    [profileStore replaceCurrentUser:user];
} onFailure:^(NSInteger code, NSString *message) {
    NSLog(@"getSelfInfo failed: %ld %@", (long)code, message);
}];

Return value

The onSuccess callback delivers an OIMUserInfo object containing the authenticated user's current settings:

PropertyTypeDescription
userIDNSString *The authenticated user's unique identifier.
nicknameNSString *User's profile display name.
faceURLNSString *User's profile avatar URL.
exNSString *Custom application extension metadata string.
globalRecvMsgOptOIMReceiveMessageOptAccount-level global message reception policy.

This query retrieves an instantaneous snapshot and does not emit delegate updates. To update these attributes, refer to Update your profile.