startAsync static method
Start appcenter functionalities
Implementation
static Future startAsync({
required String appSecretAndroid,
required String appSecretIOS,
enableAnalytics = true,
enableCrashes = true,
disableAutomaticCheckForUpdate = false,
}) async {
String appsecret;
if (Platform.isAndroid) {
appsecret = appSecretAndroid;
} else if (Platform.isIOS) {
appsecret = appSecretIOS;
} else {
throw UnsupportedError('Current platform is not supported.');
}
if (appsecret.isEmpty) {
return;
}
WidgetsFlutterBinding.ensureInitialized();
await configureAnalyticsAsync(enabled: enableAnalytics);
await configureCrashesAsync(enabled: enableCrashes);
await _methodChannel.invokeMethod('start', <String, dynamic>{
'secret': appsecret.trim(),
});
}