login method
- NIMLoginInfo loginInfo
登录接口。sdk会自动连接服务器,传递用户信息,返回登录结果。
Implementation
Future<NIMResult<void>> login(NIMLoginInfo loginInfo) {
final info;
final sdkOptions = NimCore.instance.sdkOptions;
if (sdkOptions != null && loginInfo.customClientType == null) {
info = NIMLoginInfo(
account: loginInfo.account,
token: loginInfo.token,
authType: loginInfo.authType,
loginExt: loginInfo.loginExt,
customClientType: sdkOptions.customClientType,
);
} else {
info = loginInfo;
}
return _platform.login(info);
}