Cordova in app browser works on browser but not on android phone

283 Views Asked by At

I m trying to open an external link for connecting to dropbox. When i try it on the browser, everything is fine.A Pop up opens for authentication as expected. But when i try it on the phone after converting to apk, it doesnt work. Any ideas what am i doing wrong ?

 connectDroppbox() {
      let dbx = new Dropbox({ clientId: this.CLIENT_ID });
      let str = dbx.getAuthenticationUrl("http://localhost:8100");
      var browserRef  = this.$cordovaInAppBrowser.open(str, '_blank', this.defaultOptions);
    }
1

There are 1 best solutions below

2
On
 let str = dbx.getAuthenticationUrl("http://localhost:8100");

This url won't work while in an app. What would be localhost in that case? Itself?