You can use any url you want to listen to the loadstart event and check if this url loads, if the redirect was ok
Install the inAppBrowser plugin first if you havenโt already done so cordova plugin add cordova-plugin-inappbrowser
and use window.cordova.InAppBrowser.open instead of window.open (the API has changed a long time ago)
Your code should look something like this:
var link = "https://connect.stripe.com/oauth/authorize?response_type=code&client_id=MYCLIENTID&scope=read_write"; var browserRef = window.cordova.InAppBrowser.open(link, '_blank', 'location=no'); browserRef.addEventListener('loadstart', function(event) { if((event.url).indexOf(yourRedirectUri) === 0) { //Loaded the redirect url } });
Where yourRedirectUri is the URL you used in the strip
jcesarmobile
source share