Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70749

inAppBrowser event.url does not return current URL

$
0
0

@simonjcarr wrote:

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();
      }
    })
  }

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70749

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>