Creates a reference to a bucket for this user
The bucket will be created/accessed within this user's scope
The name of the bucket the user should create/access
A working KiiBucket object
Change email of logged in user. If the email address verification is required by your app configuration, User's email would not changed to new one until the new email verification has been done. In this case, new mail address can be obtained by KiiUser.getPendingEmailAddress. This API does not refresh the KiiUser automatically. Please execute KiiUser.refresh before checking the value of KiiUser.getEmailAddress or KiiUser.getPendingEmailAddress
The new email address to change to
return promise object.
Change phone number of logged in user. If the phone number verification is required by your app configuration, User's phone number would not changed to new one until the new phone number verification has been done. In this case, new phone can be obtained by KiiUser.getPendingPhoneNumber. This API does not refresh the KiiUser automatically. Please execute KiiUser.refresh before checking the value of KiiUser.getPhoneNumber or KiiUser.getPendingPhoneNumber.
The new phone number to change to
return promise object.
Delete the user from the server
return promise object.
Return true if the user is disabled, false when enabled and undefined when user is not refreshed. Call KiiUser.refresh prior calling this method to get correct status.
Creates a reference to a encrypted bucket for this user
The bucket will be created/accessed within this user's scope
The name of the bucket the user should create/access
Gets the value associated with the given key
The key to retrieve
The object associated with the key. null or undefined if none exists
Get the access token for the user - only available if the user is currently logged in
Access token
Return the access token and token expire time in a object.
Key | Type | Value |
---|---|---|
"access_token" | String | required for accessing KiiCloud |
"expires_at" | Date | Access token expiration time, null if the user is not login user. |
Access token and token expires in a object.
Get the country code associated with this user
Get the server's creation date of this user
Get the display name associated with this user
Get the email address associated with this user
Get the status of the user's email verification. This field is assigned by the server
true if the user's email address has been verified by the user, false otherwise. Could be undefined if haven't obtained value from server or not allowed to see the value. Should be used by current login user to check the email verification status.
Get the ID of the current KiiUser instance.
Id of the user or null if the user has not saved to cloud.
Get the social accounts that is linked to this user. Refresh the user by KiiUser.refresh prior call the method. Otherwise, it returns empty object.
Social network name as key and account info as value.
Get the locale associated with this user
Get the email of this user that has not been verified. When the user's email has been changed and email verification is required in you app configuration, New email is stored as pending email. After the new email has been verified, the address can be obtained by KiiUser.getEmailAddress
User's new email address has not been verified. null if no pending email field is included in refresh response or undefined when no refresh operation has been done before.
Get the phone of this user that has not been verified. When the user's phone has been changed and phone verification is required in you app configuration, New phone is stored as pending phone. After the new phone has been verified, the address can be obtained by KiiUser.getPhoneNumber
User's new phone number has not been verified. null if no pending phone field is included in refresh response or undefined when no refresh operation has been done before.
Get the phone number associated with this user
Get the status of the user's phone number verification. This field is assigned by the server
true if the user's email address has been verified by the user, false otherwise Could be undefined if haven't obtained value from server or not allowed to see the value. Should be used by current login user to check the phone verification status.
Id of the user or null if the user has not saved to cloud.
Get the username of the given user
username or undefined
Get the status of the user's email verification. This field is assigned by the server
true if the user's email address has been verified by the user, false otherwise. Could be undefined if haven't obtained value from server or not allowed to see the value. Should be used by current login user to check the email verification status.
Get the status of the user's phone number verification. This field is assigned by the server
true if the user's email address has been verified by the user, false otherwise Could be undefined if haven't obtained value from server or not allowed to see the value. Should be used by current login user to check the phone verification status.
Get whether or not the user is pseudo user. If this method is not called for current login user, calling KiiUser.refresh method is necessary to get a correct value.
whether this user is pseudo user or not.
Gets a list of topics in this user scope
You can specify the pagination key with the nextPaginationKey passed by callbacks.success. If empty string or no string object is provided, this API regards no paginationKey specified.
return promise object.
Retrieve a list of groups which the user is a member of
return promise object.
Get a specifically formatted string referencing the user
The user must exist in the cloud (have a valid UUID).
A URI string based on the given user. null if a URI couldn't be generated.
Retrieve the groups owned by this user. Group in the groupList does not contain all the property of group. To get all the property from cloud, a KiiGroup.refresh is necessary.
return promise object.
Instantiate push installation for this user.
push installation object.
Instantiate push subscription for this user.
push subscription object.
Sets credentials data and custom fields to pseudo user.
This method is exclusive to pseudo user. password is mandatory and needs to provide at least one of login name, email address or phone number.
identityData
The user's password. Valid pattern is ^[\x20-\x7E]{4,50}$.
Custom Fields to add to the user. This is optional and can be omitted.
An array of field names to remove from the user custom fields. Default fields are not removed from server. This is optional and can be omitted.
return promise object.
Updates the local user's data with the user data on the server
The user must exist on the server. Local data will be overwritten.
return promise object.
Registers a user with the server
The user object must have an associated email/password combination.
return promise object.
Resend the email verification code to the user
This method will re-send the email verification to the currently logged in user
return promise object.
Resend the SMS verification code to the user
This method will re-send the SMS verification to the currently logged in user
return promise object.
Saves the latest user values to the server
If the user does not yet exist, it will NOT be created. Otherwise, the fields that have changed will be updated accordingly.
return promise object.
Sets a key/value pair to a KiiUser
If the key already exists, its value will be written over. If key is empty or starting with '_', it will do nothing. Accepted types are any JSON-encodable objects.
The key to set. The key must not be a system key (created, metadata, modified, type, uuid) or begin with an underscore (_)
The value to be set. Object must be of a JSON-encodable type (Ex: dictionary, array, string, number, etc)
Set the country code associated with this user
The country code to set. Must be 2 alphabetic characters. Ex: US, JP, CN
Set the display name associated with this user. Cannot be used for logging a user in; is non-unique
Must be between 1-50 alphanumeric characters.
Set the locale associated with this user The locale argument must be BCP 47 language tag. Examples: "en": English "de-AT": German as used in Austria. "zh-Hans-CN": Chinese written in simplified characters as used in China.
The locale to set.
Instantiate topic belongs to this user.
name of the topic. Must be a not empty string.
topic instance.
Update user attributes.
If you want to update identity data of pseudo user, you must use KiiUser.putIdentity instead.
identityData
Custom Fields to add to the user.
An array of field names to remove from the user custom fields. Default fields are not removed from server.
return promise object.
Update a user's password on the server
Update a user's password with the server. The fromPassword must be equal to the current password associated with the account in order to succeed.
The user's current password
The user's desired password. Must be at least 4 characters, made up of alphanumeric and/or: @,#,$,%,^,&
return promise object.
Verify the current user's phone number
This method is used to verify the phone number of user currently
logged in.
Verification code is sent from Kii Cloud when new user is registered with
phone number or user requested to change their phone number in the
application which requires phone verification.
(You can enable/disable phone verification through the console in
developer.kii.com)
After the verification succeeded, new phone number becomes users phone
number and user is able to login with the phone number.
To get the new phone number, please call KiiUser.refresh and call
KiiUser.getPhoneNumber
Before completion of KiiUser.refresh, KiiUser.getPhoneNumber returns
cached phone number. It could be old phone number or undefined.
The code which verifies the currently logged in user
return promise object.
Authenticates a user with the server.
If authentication successful, the user is cached inside SDK as current user,and accessible via
KiiUser.getCurrentUser.
User token and token expiration is also cached and can be get by KiiUser.getAccessTokenObject.
Access token won't be expired unless you set it explicitly by Kii.setAccessTokenExpiration.
If password or userIdentifier is invalid, reject callback of promise will be called.
The username, validated email address, or validated phone number of the user to authenticate
The password of the user to authenticate
KiiApplication instance. When omitted, KiiApplication.globalApp is used.
return promise object.
Asynchronously authenticates a user with the server using specified recovery code.
This method is non-blocking.
A valid recovery code
return promise object.
Asynchronously authenticates a user with the server using specified access token.
This method is non-blocking.
Specified expiresAt won't be used by SDK. IF login successful,
we set this property so that you can get it later along with token
by KiiUser.getAccessTokenObject.
Also, if successful, the user is cached inside SDK as current user
and accessible via KiiUser.getCurrentUser.
Note that, if not specified, token expiration time is not cached
and set to value equivalant to 275760 years.
If the specified token is expired, authenticataiton will be failed.
Authenticate the user again to renew the token.
If expiresAt is invalid, reject callback of promise will be called.
A valid access token associated with the desired user
Access token expire time that has received by KiiUser.getAccessTokenObject. This param is optional and can be omitted.
KiiApplication instance. When omitted, KiiApplication.globalApp is used.
return promise object.
Asynchronously authenticates a user with the server using specified totp code.
This method is non-blocking.
A valid totp code
KiiApplication instance. When omitted, KiiApplication.globalApp is used.
return promise object.
Reset password with the PIN code in receipt SMS After KiiUser.resetPasswordWithNotificationMethod is called with "SMS_PIN", SMS includes the PIN code will be sent to the user's phone. User can request the new password for login with the PIN code. Need to call method for authentication after the new password is determined.
should be valid email address, global phone number or user identifier obtained by KiiUser.getID.
Received PIN code.
New password for login. If the 'Password Reset Flow' in app's security setting is set to 'Generate password', it would be ignored and null can be passed. In this case, new password is generated on Kii Cloud and sent to user's phone. Otherwise valid password is required.
KiiApplication instance. When omitted, KiiApplication.globalApp is used.
return promise object.
Find registered KiiUser with the email.
If there are no user registers with the specified email or if there are but not verified email yet,
callbacks.failure or reject callback of promise will be called.
Note:
The email to find KiiUser who owns it.
KiiApplication instance. When omitted, KiiApplication.globalApp is used. Don't add prefix of "EMAIL:" described in REST API documentation. SDK will take care of it.
return promise object.
Find registered KiiUser with the phone. If there are no user registers with the specified phone or if there are but not verified phone yet, callbacks.failure or reject callback of promise will be called.
Note:
The phone number to find KiiUser who owns it. Don't add prefix of "PHONE:" described in REST API documentation. SDK will take care of it.
KiiApplication instance. When omitted, KiiApplication.globalApp is used.
return promise object.
Find registered KiiUser with the user name. If there are no user registers with the specified user name, callbacks.failure or reject callback of promise will be called.
Note:
The user name to find KiiUser who owns it. Don't add prefix of "LOGIN_NAME:" described in REST API documentation. SDK will take care of it.
KiiApplication instance. When omitted, KiiApplication.globalApp is used.
return promise object.
The currently authenticated user
KiiApplication instance. When omitted, KiiApplication.globalApp is used.
Logs the currently logged-in user out of the KiiSDK
KiiApplication instance. When omitted, KiiApplication.globalApp is used.
Checks to see if there is a user authenticated with the SDK
KiiApplication instance. When omitted, KiiApplication.globalApp is used.
Registers a user as pseudo user with the server
Custom Fields to add to the user. This is optional and can be omitted.
KiiApplication instance. When omitted, KiiApplication.globalApp is used.
return promise object.
Reset a user's password on the server
Reset a user's password on the server. The user is determined by the specified userIdentifier - which is an email address that has already been associated with an account. Reset instructions will be sent to that identifier. Please Note: This will reset the user's access token, so if they are currently logged in - their session will no longer be valid.
The user's email address
KiiApplication instance. When omitted, KiiApplication.globalApp is used.
return promise object.
Reset the password of user. Reset the password of user specified by given identifier. This api does not execute login after reset password.
should be valid email address, global phone number or user identifier obtained by KiiUser.getID.
specify the destination of message include link of resetting password. must one of "EMAIL", "SMS" or "SMS_PIN".
KiiApplication instance. When omitted, KiiApplication.globalApp is used.
return promise object.
Create a user object to prepare for registration with credentials pre-filled
Creates a pre-filled user object for registration. This user will not be authenticated until the registration method is called on it. It can be treated as any other KiiUser before it is registered.
The user's email address
The user's phone number
The user's desired username. Must be between 3 and 64 characters, which can include alphanumeric characters as well as underscores '_', dashes '-' and periods '.'
The user's password. Must be at least 4 characters, made up of alphanumeric and/or: @,#,$,%,^,&
KiiApplication instance. When omitted, KiiApplication.globalApp is used.
a working KiiUser object
Create a user object to prepare for registration with credentials pre-filled
Creates a pre-filled user object for registration. This user will not be authenticated until the registration method is called on it. It can be treated as any other KiiUser before it is registered.
The user's email address
The user's password. Must be at least 4 characters, made up of alphanumeric and/or: @,#,$,%,^,&
KiiApplication instance. When omitted, KiiApplication.globalApp is used.
a working KiiUser object
Create a user object to prepare for registration with credentials pre-filled
Creates a pre-filled user object for registration. This user will not be authenticated until the registration method is called on it. It can be treated as any other KiiUser before it is registered.
The user's email address
The user's phone number
The user's password. Must be at least 4 characters, made up of alphanumeric and/or: @,#,$,%,^,&
KiiApplication instance. When omitted, KiiApplication.globalApp is used.
a working KiiUser object
Create a user object to prepare for registration with credentials pre-filled
Creates a pre-filled user object for registration. This user will not be authenticated until the registration method is called on it. It can be treated as any other KiiUser before it is registered.
The user's email address
The user's desired username. Must be between 3 and 64 characters, which can include alphanumeric characters as well as underscores '_', dashes '-' and periods '.'
The user's password. Must be at least 4 characters, made up of alphanumeric and/or: @,#,$,%,^,&
KiiApplication instance. When omitted, KiiApplication.globalApp is used.
a working KiiUser object
Instantiate KiiUser that refers to existing user which has specified ID.
You have to specify the ID of existing KiiUser. Unlike KiiObject,
you can not assign ID in the client side.
NOTE: This API does not access to the server.
After instantiation, call KiiUser.refresh to fetch the properties.
ID of the KiiUser to instantiate.
KiiApplication instance. When omitted, KiiApplication.globalApp is used.
instance of KiiUser.
Create a user object to prepare for registration with credentials pre-filled
Creates a pre-filled user object for registration. This user will not be authenticated until the registration method is called on it. It can be treated as any other KiiUser before it is registered.
The user's phone number
The user's password. Must be at least 4 characters, made up of alphanumeric and/or: @,#,$,%,^,&
KiiApplication instance. When omitted, KiiApplication.globalApp is used.
a working KiiUser object
Create a user object to prepare for registration with credentials pre-filled
Creates a pre-filled user object for registration. This user will not be authenticated until the registration method is called on it. It can be treated as any other KiiUser before it is registered.
The user's phone number
The user's desired username. Must be between 3 and 64 characters, which can include alphanumeric characters as well as underscores '_', dashes '-' and periods '.'
The user's password. Must be at least 4 characters, made up of alphanumeric and/or: @,#,$,%,^,&
KiiApplication instance. When omitted, KiiApplication.globalApp is used.
a working KiiUser object
Generate a new KiiUser based on a given URI
The URI of the object to be represented
KiiApplication instance. When omitted, KiiApplication.globalApp is used.
A new KiiUser with its parameters filled in from the URI
Create a user object to prepare for registration with credentials pre-filled
Creates a pre-filled user object for manipulation. This user will not be authenticated until one of the authentication methods are called on it. It can be treated as any other KiiObject before it is authenticated.
The user's desired username. Must be between 3 and 64 characters, which can include alphanumeric characters as well as underscores '_', dashes '-' and periods '.'
The user's password. Must be between 4-50 characters, made up of ascii characters excludes control characters.
KiiApplication instance. When omitted, KiiApplication.globalApp is used.
a working KiiUser object
Generated using TypeDoc
Represents a KiiUser object