提交工单
咨询集成、功能及报价等问题
ZEGOCLOUD's In-app Chat (the ZIM SDK) provides the capability of user management, allows users to update their personal profile, such as username, and status updates.
userName
is a string that can be set by configuring the ZIMUserInfo
object.
To change the userName
after logging in, call the updateUserName
method.
You will receive the results through the callback ZIMUserNameUpdatedCallback
.
- (void)updateUserName:(NSString *)userName callback:(ZIMUserNameUpdatedCallback)callback;
Parameter | Type | Required | Description |
---|---|---|---|
userName | NSString | Yes | New username. |
callback | ZIMUserNameUpdatedCallback | Yes | Callback for change a new username. |
// Change username.
NSString *userName = @"";
[zim updateUserName:userName callback:^(NSString * _Nonnull userName, ZIMError * _Nonnull errorInfo) {
}];
To query and view the user profile (username, extension fields) of a specified user, call the queryUsersInfo
method. The user extended field info can be obtained only using this method.
You will receive the query results through the callback ZIMUsersInfoQueriedCallback
.
- (void)queryUsersInfo:(NSArray<NSString *> *)userIDs
callback:(ZIMUsersInfoQueriedCallback)callback;
Parameter | Type | Required | Description |
---|---|---|---|
userIDs | NSArray<NSString *> | Yes | List of the user IDs to be queried. |
callback | ZIMUsersInfoQueriedCallback | Yes | Callback for query user profile. |
// Query user profile.
[self.zim queryUsersInfo:@[@"userID_1",@"userID_2"] callback:^(NSArray<ZIMUserFullInfo *> * _Nonnull userList, NSArray<ZIMErrorUserInfo *> * _Nonnull errorUserList, ZIMError * _Nonnull errorInfo) {
}];