Last active
December 11, 2015 09:28
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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