Skip to content

Instantly share code, notes, and snippets.

@raulriera
Last active December 11, 2015 09:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raulriera/4579638 to your computer and use it in GitHub Desktop.
Save raulriera/4579638 to your computer and use it in GitHub Desktop.
Since android doesn't support opening the market from web views. This seems like a pretty good hack. Idea from http://stackoverflow.com/questions/3583264/support-for-other-protocols-in-android-webview
webView.addEventListener("load", function(e){
if (e.url != null && e.url.indexOf("market://") != -1) {
// Open the URL from the device
Titanium.Platform.openURL(e.url);
// Reset the URL to the initial one
webView.url = url; // url is set somewhere in your code
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment