login method Null safety
Log in
Parameter
@required String userID,
@required String userSig,
To log in, you need to set the username userID and the user signature userSig. For the generation of userSig, please refer to the UserSig background API.
Note:
The ticket expires when logging in: the callback of the login function will return the error code ERR_USER_SIG_EXPIRED: 6206, and a new userSig will be generated at this time to log in again.
The ticket expires when online: the user may also receive the V2TIMListener -> onUserSigExpired callback while the user is online, and you need to generate a new userSig and log in again at this time.
Kicked offline while online: The SDK will notify you through the V2TIMListener -> onKickedOffline callback when the user is kicked online. At this time, the UI can prompt the user and call login() again to log in again.
Implementation
Future<V2TimCallback> login({
required String userID,
required String userSig,
}) {
return ImFlutterPlatform.instance.login(userID: userID, userSig: userSig);
}