User-Level Configuration
This document describes the interfaces related to user-level configuration.
User-Level Configuration Event Callback
tip
Supported starting from version 5.24.0.
Listening to User-Level Configuration Synchronization Events
After a user successfully connects, the SDK fetches the current user's configuration information. Upon successful retrieval, the App is notified via the onUserSettingsSync callback in the UserSettingsListener. Developers need to register this listener using the addUserSettingsListener interface in RongCoreClient.
Sample Code
- Registering a User-Level Configuration Event Listener
// Add user configuration event listener
RongCoreClient.getInstance().addUserSettingsListener(listener)
// Remove user configuration event listener
RongCoreClient.getInstance().removeUserSettingsListener(listener)
- Implementing the User-Level Configuration Synchronization Callback Method
/**
* User-level event delegate.
*
* <p>Use the getAppSettings interface of CoreClient to query the related configuration isUserSettingsEnabled.
*
*/
interface UserSettingsListener {
/**
* Callback when all user-level configuration information is synchronized.
*
* <p>After a successful connection, the SDK synchronizes all configurations for the current user and invokes this method upon completion.
*
* @param code Error code
*/
void onUserSettingsSync(IRongCoreEnum.CoreErrorCode code);
}