Search code examples
typescriptcordovaionic-frameworkionic3inappbrowser

Ionic InAppBrowser iOS opens new tab and in devapp 'loading...' screen


I've searched on the internet but still haven't found a solution for my problem, i have a question about InAppBrowser from ionic. my problem is that I can't get it to work whatever I try to do. I already set it to target '_blank' as you can see in the code below

public openPagina(url) {

  const Options: InAppBrowserOptions = {
      zoom: 'no',
      location:'yes',
      toolbar:'yes',
      clearcache: 'yes',
      clearsessioncache: 'yes',
      disallowoverscroll: 'yes',
      enableViewportScale: 'yes',
      hidden: 'yes'
  }
    const browser = this.inAppBrowser.create( url , '_blank', Options );
    browser.show();
}

I already added this code into my config.xml

<allow-intent href="http://*/*"/>
<allow-intent href="https://*/*"/>

I'm not sure what to do next as in solutions, I've tried '_self' but that doesn't solve the problem because it doesn't show an exit or done button and scrolling doesn't work quite well ( I tried this on the DevApp)

I have tested the 3 methods: '_self', '_blank' and '_system' on an iOS device (building and running on xCode) but all of them opened in a new tab on my iOS Device. On android everything works fine.

versions: ionic (Ionic CLI) : 4.2.1 Ionic Framework : ionic-angular 3.9.2 @ionic/app-scripts : 3.2.0 cordova (Cordova CLI) : 8.1.2 NodeJS : v8.12.0 npm : 6.4.1

If I need to add more code feel free to ask!(kinda new to stackoverflow x) )

screenshot of my phone with the closebuttoncaption: 'Close' included. https://gyazo.com/38cd96faad3428586fe5e4572b60392c This is what i get when im using _self method.

Still haven't found a solution to this problem. The devapp shows this: https://gyazo.com/efeedb5f5d400a742f55c35a3f5d0caa if I open the link in '_blank' . Does anybody know how to fix these/this problem(s)?

I thank you in advance.


Solution

  • The problem was in xCode it self, everytime i hit build it build another version (older one) and not good version. So after building in CMD first and running in xcode it finally worked and inappbrowser worked aswell!