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 publisher. | |
Login. | |
Logout. | |
Set personal information. | |
Set offline push certificate IDs. |
public static let shared: LoginStore = LoginStoreImpl()
public func login(sdkAppID: Int32, userID: String, userSig: String, completion: CompletionClosure?) {}
Parameter | Type | Description |
sdkAppID | Int32 | |
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. |
public func logout(completion: CompletionClosure?) {}
Parameter | Type | Description |
completion | Completion callback. |
public func setSelfInfo(userProfile: UserProfile, completion: CompletionClosure?) {}
Parameter | Type | Description |
userProfile | User profile. | |
completion | Completion callback. |
public func setCertificateID(apnsCertificateID: Int = 0, voipCertificateID: Int = 0) {}
Parameter | Type | Description |
apnsCertificateID | Int | APNs push certificate ID. Pass 0 to disable APNs push. |
voipCertificateID | Int | VoIP push certificate ID. Pass 0 to disable VoIP push. Defaults to 0. |
Enum Value | Description |
unlogin | Not logged in. |
logined | Logged in. |
Enum Value | Value | Description |
allowAny | 0 | Allow anyone. |
needConfirm | 1 | Need confirmation. |
denyAny | 2 | Deny anyone. |
Enum Value | Value | Description |
unknown | 0 | Unknown. |
male | 1 | Male. |
female | 2 | Female. |
Enum Value | Description |
kickedOffline | Current user kicked offline. |
loginExpired | Login ticket expired. |
Property | Type | Description |
userID | String | User ID. |
nickname | String? | Nickname. |
avatarURL | String? | Avatar URL. |
selfSignature | String? | Personal signature. |
gender | Gender. | |
role | UInt32? | Role. This field has no business restrictions, so you can safely use any valid integer value. |
level | UInt32? | Level. This field has no business restrictions, so you can safely use any valid integer value. |
birthday | UInt32? | Birthday. This field has no business restrictions, so you can safely use any valid integer value. |
allowType | Friend verification type. | |
customInfo | [String: Data]? | Custom information. |
Property | Type | Description |
loginStatus | Login status. | |
loginUserInfo | Logged-in user information. |
フィードバック