diff --git a/README.md b/README.md index f19b51f..ed42fb2 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ In order to use the `close` event on Android it is recommended to have a short d * `close` -> `success` (Boolean), `url` (String) * `load` -> `success` (Boolean), `url` (String) - iOS only * `redirect` -> `url` (String) - iOS only +* `error` -> `message` (String) - Android only ### `AuthenticationSession` (iOS only) diff --git a/android/manifest b/android/manifest index 198f04d..65d644b 100644 --- a/android/manifest +++ b/android/manifest @@ -2,7 +2,7 @@ # this is your module manifest and used by Titanium # during compilation, packaging, distribution, etc. # -version: 2.2.0 +version: 2.2.1 apiversion: 4 architectures: arm64-v8a armeabi-v7a x86 x86_64 description: titanium-web-dialog diff --git a/android/src/ti/webdialog/TitaniumWebDialogModule.java b/android/src/ti/webdialog/TitaniumWebDialogModule.java index 6548054..3823b6d 100644 --- a/android/src/ti/webdialog/TitaniumWebDialogModule.java +++ b/android/src/ti/webdialog/TitaniumWebDialogModule.java @@ -155,7 +155,14 @@ private void openCustomTab(Context context, List customTabBrowsers, Krol tabIntent.intent.setPackage(s); } - tabIntent.launchUrl(context, Uri.parse(url)); + try { + tabIntent.launchUrl(context, Uri.parse(url)); + } catch (Exception e) { + KrollDict event = new KrollDict(); + event.put("message", e.getLocalizedMessage()); + + fireEvent("error", event); + } } private Bitmap getIcon(String path)