initApp static method

Future<void> initApp({
  1. String? applicationId,
  2. String? androidApiKey,
  3. String? iosApiKey,
  4. String? jsApiKey,
  5. String? customDomain,
})

Implementation

static Future<void> initApp(
    {String? applicationId,
    String? androidApiKey,
    String? iosApiKey,
    String? jsApiKey,
    String? customDomain}) async {
  if (customDomain != null) {
    _prefs.initPreferences(customDomain: customDomain);
    return _channel
        .invokeMethod('Backendless.initApp', {'customDomain': customDomain});
  }

  String apiKey;
  if (kIsWeb)
    apiKey = jsApiKey!;
  else if (Platform.isAndroid)
    apiKey = androidApiKey!;
  else if (Platform.isIOS)
    apiKey = iosApiKey!;
  else
    return;

  _prefs.initPreferences(appId: applicationId, apiKey: apiKey);

  return _channel.invokeMethod('Backendless.initApp',
      <String, dynamic>{'applicationId': applicationId, 'apiKey': apiKey});
}