Skip to main content

setUserListener

Feature Introduction

Description

Set user event listener. It provides asynchronous callback notifications for changes in the login user's profile and changes in the online status of subscribed users. This ensures the UI is updated promptly.

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 updates

Code Example


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

} onUserStatusChanged:^(OIMUserStatusInfo * _Nullable statusInfo) {

}];