Skip to main content

setUserListener

Description​

info

Set a user event listener to receive asynchronous callback notifications for changes in logged-in user profiles and online status changes of subscribed users, so that the UI can perceive and handle them in time.

Note

(1) Call immediately after initSDK;
(2) Can only be called once.

Function Prototype​

- (void)setUserListenerWithUserInfoUpdate:(nullable OIMUserInfoCallback)onUserInfoUpdate
onUserStatusChanged:(nullable OIMUserStatusInfoCallback)onUserStatusChanged;

Return Result​

Parameter NameParameter TypeDescription
onUserInfoUpdateOIMUserInfoCallback function for user info updates
onUserStatusChangedOIMUserStatusInfoCallback function for user status changes

Code Example​


[OIMManager.callbacker setSelfUserInfoUpdateListenerWithUserInfoUpdate:^(OIMUserInfo * _Nullable userInfo) {

} onUserStatusChanged:^(OIMUserStatusInfo * _Nullable statusInfo) {

}];