diff --git a/lib/src/api.dart b/lib/src/api.dart index 8bdd47f..51b2222 100644 --- a/lib/src/api.dart +++ b/lib/src/api.dart @@ -53,13 +53,15 @@ class FlutterCallkeep extends EventManager { return _channel.invokeMethod('registerEvents', {}); } - Future hasDefaultPhoneAccount( + Future hasDefaultPhoneAccount( BuildContext context, Map options) async { _context = context; if (!isIOS) { - return _hasDefaultPhoneAccount(options); + return await _hasDefaultPhoneAccount(options); } - return; + + // return true on iOS because we don't want to block the endUser + return true; } Future _checkDefaultPhoneAccount() async { @@ -67,12 +69,14 @@ class FlutterCallkeep extends EventManager { .invokeMethod('checkDefaultPhoneAccount', {}); } - Future _hasDefaultPhoneAccount(Map options) async { + Future _hasDefaultPhoneAccount(Map options) async { final hasDefault = await _checkDefaultPhoneAccount(); final shouldOpenAccounts = await _alert(options, hasDefault); - if (shouldOpenAccounts == true) { + if (shouldOpenAccounts) { await _openPhoneAccounts(); + return true; } + return false; } Future displayIncomingCall(String uuid, String handle,