Is there any javascript framework/technique that allows to send asynchronous requests with custom scheme urls? Trying this with Ajax:
$.ajax({url: "myapp://root", success: function(result){
console.log(result);
}});
expectedly gets me the below error
XMLHttpRequest cannot load myapp://root. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
I'm trying to figure a way to check whether a deep link sent to my iOS app has been successfully received before I redirect to its iTunes page. My current javascript waits for a timeout before redirecting to iTunes, and that's not working as intended; a dialog pops up to ask whether the user wants to open the app, and if the timeout expires before they make their decision, they still get redirected to iTunes even if the dialog hasn't been answered/dismissed yet.
Here's my javascript:
window.location = "myapp://somepath";
setTimeout(function() {
window.location = "https://itunesurl";
}, 500);
Obviously increasing the timeout is not the solution I'm looking for.