configure static method
Initializes the SDK.
Param options The configurations: {@link EMOptions}. Ensure that you set this parameter.
Implementation
static Future<bool> configure(String? appKey) async {
if (kIsWeb) {
return true;
}
if (appKey == null) {
return false;
}
try {
if (EMClient.getInstance.options != null) {
await EMClient.getInstance.changeAppKey(newAppKey: appKey);
} else {
final options =
EMOptions(appKey: appKey, autoLogin: false, debugModel: true);
await EMClient.getInstance.init(options);
}
return true;
} catch (e) {
return false;
}
}