LoginStore provides a complete set of login management APIs, including user login, logout, and personal information settings. Through this class, you can manage user login status and user profiles.LoginStore instance.Property | Type | Description |
loginStatus | Login status. | |
loginUserInfo | Logged-in user information. |
Function | Description |
Singleton object. | |
Login event listener. | |
Login event listener. | |
Login. | |
Logout. | |
Set personal information. | |
Set offline push certificate IDs. |
abstract fun addLoginListener(listener: LoginListener)
Parameter | Type | Description |
listener | Login listener. |
abstract fun removeLoginListener(listener: LoginListener)
Parameter | Type | Description |
listener | Login listener. |
abstract fun login(context: Context,sdkAppID: Int,userID: String,userSig: String,completion: CompletionHandler? = null)
Parameter | Type | Description |
context | Context | Context. |
sdkAppID | Int | |
userID | String | User ID. The recommended length limit is 32 bytes, and only uppercase and lowercase English letters (a-zA-Z), digits (0-9), underscores, and hyphens are allowed. |
userSig | String | User signature. For the generation of userSig, please refer to the Secure authentication with userSig. |
completion | Completion callback. |
abstract fun logout(completion: CompletionHandler? = null)
Parameter | Type | Description |
completion | Completion callback. |
abstract fun setSelfInfo(userProfile: UserProfile,completion: CompletionHandler? = null)
Parameter | Type | Description |
userProfile | User profile. | |
completion | Completion callback. |
abstract fun setCertificateID(config: Map<String, String>)
Map<String, String>. The SDK will detect the current device brand, request the device token from the corresponding vendor and report it to the IM backend automatically. Can be called at any time; calling in Application.onCreate is recommended. If invoked before login, the SDK caches the configuration and starts push registration automatically once login succeeds. Certificate IDs are obtained from the IM Console after uploading push certificates. The map keys must follow the strings in the table below; unknown keys are ignored, and a channel is not enabled when its value is missing. Key | Description |
huaweiCertificateId | Huawei push certificate ID. |
xiaomiCertificateId | Xiaomi push certificate ID. |
xiaomiAppId | Xiaomi open platform AppId. |
xiaomiAppKey | Xiaomi open platform AppKey. |
oppoCertificateId | OPPO push certificate ID. |
oppoAppKey | OPPO open platform AppKey. |
oppoAppSecret | OPPO open platform AppSecret. |
vivoCertificateId | vivo push certificate ID. |
honorCertificateId | Honor push certificate ID. |
meizuCertificateId | Meizu push certificate ID. |
meizuAppId | Meizu open platform AppId. |
meizuAppKey | Meizu open platform AppKey. |
fcmCertificateId | FCM (Firebase) push certificate ID. |
Parameter | Type | Description |
config | Map<String, String> | Vendor push certificate configuration. The keys are predefined strings (see the "Supported keys" table above); unknown keys are ignored, and a channel is not enabled when its value is missing. |
Enum Value | Description |
UNLOGIN | Not logged in. |
LOGINED | Logged in. |
Enum Value | Value | Description |
ALLOW_ANY | 0 | Allow anyone. |
NEED_CONFIRM | 1 | Need confirmation. |
DENY_ANY | 2 | Deny anyone. |
Enum Value | Value | Description |
UNKNOWN | 0 | Unknown. |
MALE | 1 | Male. |
FEMALE | 2 | Female. |
Method | Description |
onKickedOffline | Current user kicked offline. |
onLoginExpired | Login ticket expired. |
Property | Type | Description |
userID | String | User ID. |
nickname | String? | Nickname. |
avatarURL | String? | Avatar URL. |
selfSignature | String? | Personal signature. |
gender | Gender. | |
role | Int? | Role. This field has no business restrictions, so you can safely use any valid integer value. |
level | Int? | Level. This field has no business restrictions, so you can safely use any valid integer value. |
birthday | Long? | Birthday. This field has no business restrictions, so you can safely use any valid integer value. |
allowType | Friend verification type. | |
customInfo | Map<String, ByteArray>? | Custom information. |
Property | Type | Description |
loginStatus | Login status. | |
loginUserInfo | Logged-in user information. |
피드백