login method

FutureOr<int> login(
  1. String token,
  2. String uid
)

@detail api @author hanchenchen.c @brief Log in to call sendUserMessageOutsideRoom{@link #RTCEngine#sendUserMessageOutsideRoom} and sendServerMessage{@link #RTCEngine#sendServerMessage} to send P2P messages or send messages to a server without joining the RTC room.
To log out, call logout{@link #RTCEngine#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
User ID is unique within one appid. @return - 0: Success. - <0: Failure. See ReturnStatus{@link #ReturnStatus} for specific reasons. @note You will receive onLoginResult{@link #IRTCEngineEventHandler#onLoginResult} after calling this API and log in successfully. But remote users will not receive notification about that.

Implementation

FutureOr<int> login(String token, String uid) async {
  return await nativeCall('login', [token, uid]);
}