login abstract method
Logs in to send out-of-room messages or send messages to the business server.
The user must carry a token
for authentication while logging in.
This Token is different from that required by calling RTCRoom.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.
uid
is unique within one appId.
Returned value:
0
: Success.-1
: Failure due to invalid parameter.-2
: Failure. The user is already logged in.-3
: Failure. There is no created engine instance. Call RTCVideo.createRTCVideo before calling this method.
Notes:
- To log out, call RTCVideo.logout.
- After this API is successfully called, the local user will receive RTCVideoEventHandler.onLoginResult.
Implementation
Future<int?> login({
required String token,
required String uid,
});