I am trying to get the current URL of the user from an inAppBrowser, however it only returns to me the URL that was set when I initially opened the inAppBrowser not the current URL that the user is on. Any ideas how I solve this.
Here is my code.
authenticate(){
const browser = this.inAppBrowser.create("https://oauth.binary.com/oauth2/authorize?app_id=xxxxx",'_blank', 'location=yes');
browser.on("loadstart").subscribe((event: InAppBrowserEvent)=> {
this.currentURL = event.url;
let url = event.url;
this.liveToken = /token1=([^&]+)/.exec(url)[1];
this.testToken = /token2=([^&]+)/.exec(url)[1];
console.log(event);
console.log(event.url);
if(this.liveToken){
browser.close();
}
})
}