login method
@detail api
@author hanchenchen.c
@brief Log in to call sendUserMessageOutsideRoom:message:config:{@link #ByteRTCEngine#sendUserMessageOutsideRoom:message:config} and sendServerMessage:{@link #ByteRTCEngine#sendServerMessage} to send P2P messages or send messages to a server without joining the RTC room.
To log out, call logout{@link #ByteRTCEngine#logout}.
@param token Token is required during login for authentication.
This Token is different from that required by calling joinRoom. You can assign any value even null to roomId to generate a login token. During developing and testing, you can use temporary tokens generated on the console. Deploy the token generating application on your server.
@param uid User ID which need to be unique within one appid.
@return
- 0: Success.
- <0: Failure. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for specific reasons.
@note The local user will receive rtcEngine:onLoginResult:errorCode:elapsed:{@link #ByteRTCEngineDelegate#rtcEngine:onLoginResult:errorCode:elapsed} after this API is called successfully. But remote users will not receive notification about that.
Implementation
FutureOr<int> login(NSString token, NSString uid) async {
return await nativeCall('login:uid:', [token, uid]);
}