I'm writting some Js to call my app from browser:
var android_app_link = "myapp://something.com";
$("a[id^=this_is_id]").click(function(){
setTimeout(function() {
if (!document.webkitHidden || !document.hidden) {
show_android_popup();
}
}, 2000);
window.location = android_app_link;
});
In case of the app not installed, it works fine on Chrome but Android stock browser. Chrome did nothing with window.location = android_app_link;
and normally show popup show_android_popup();
, but stock browser received 302 net::ERR_UNKNOWN_URL_SCHEME
.
When the app is installed, everything is just fine.
As far as I know from this post:
the default browser adds an extra header to the request that makes our server think it is an ajax request and rejects it because the rest of the request is not actually an ajax request...
This bug is caused because the default browser in Android 4.1+ has added a new header to all requests "X-Requested-With: com.android.browser".
I need help on this. Thanks!