Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(android): fix uncaught exception when no intent is found #246

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion android/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion android/src/ti/webdialog/TitaniumWebDialogModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,14 @@ private void openCustomTab(Context context, List<String> 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)
Expand Down