registerLocalUserAccount abstract method
Registers the local user account.
This method registers a user account for the local user. After successful registration, the user account can be used to identify the local user, who can then join a channel using it. This method is optional. If you want users to join a channel using a user account, you can implement it in either of the following ways: Call registerLocalUserAccount to register the account first, then call joinChannelWithUserAccount to join the channel. This can reduce the time to join the channel. Directly call joinChannelWithUserAccount to join the channel. Ensure the userAccount set in this method is unique within the channel. To ensure communication quality, make sure to use the same type of user identifier within a channel. That is, use either UID or user account consistently within the same channel. If users join the channel via Web SDK, ensure they use the same identifier type.
appIdThe App ID of your project registered in the console.userAccountUser account. This parameter identifies the user in the real-time audio and video channel. You need to set and manage the user account yourself and ensure it is unique within the same channel. This parameter is required, must not exceed 255 bytes, and cannot be null. Supported character set (89 characters total): 26 lowercase letters a-z 26 uppercase letters A-Z 10 digits 0-9 Space "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "", "", "^", "_", "{", "}", "|", "~", ","
Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly. See Error Codes for details and resolution suggestions.
Implementation
Future<void> registerLocalUserAccount(
{required String appId, required String userAccount});