ionic3 - InAppBrowser plugin not working

Viewed 2280

First install InAppBrowser plugin

$ ionic cordova plugin add cordova-plugin-inappbrowser

$ npm install --save @ionic-native/in-app-browser

After that import to project.

.ts file:

  launch(url){
    this.platform.ready().then(() => {
      cordova.iab.open(url, "_blank", "location=no");
    });
  }

.html file:

<button (click)="launch('https://ionicframework.com/')" style="width:30%" ion-button color="danger" >TEST Button</button>

And when I run in IOS device, xcode show nothing in log page.

1 Answers

Finally, problem solved.

.ts file

  launch(url:string){
    this.InAppBrowser.create('https://ionicframework.com/',"_blank","location=no");
  }

.html file

<button (click)="launch(url)" style="width:30%" ion-button color="danger" >TEST Button</button>
Related