Create User
In Amity SDK, creating a new user can be done through the login method. Once the user account has been created, the user can then log into the app using their userId
and displayName
using the SDK's social and chat features.
You may need to create a new user account via the SDK, such as when integrating the SDK with an existing user authentication system. In these cases, you can use the login
method. Here's how the login
method works:
If a user already exists for the specified
userId
, the SDK will log the user into the app using the provideduserId
. ThedisplayName
parameter can be updated upon calling thelogin
method. If thedisplayName
parameter is not provided, the system will retain the existing user'sdisplayName
.If a user account does not already exist for the specified
userId
, the SDK will automatically create a new user account with the provideddisplayName
and log the user into the app. IfdisplayName
is not provided, theuserId
will be used asdisplayName
.
Note:
When user edits / adds their display name, it can be up to 100 characters in length.
When a user ID is created, it can be up to 50 characters in length.
If
displayName
is passed, but secured mode is enabled, the values will be ignored.
Last updated