init static method
Implementation
static Future<bool> init(String appId) async {
if (_hasInitializeInvoked) {
return _initializeCompleter.future;
}
_hasInitializeInvoked = true;
_methodChannel.setMethodCallHandler(_handleNativeCallback);
try {
await _methodChannel.invokeMethod('init', { 'appId': appId});
_initializeCompleter.complete(true);
return _initializeCompleter.future;
} catch (e, stack) {
if (!_initializeCompleter.isCompleted) {
_initializeCompleter.completeError(e, stack);
}
return false;
}
}