I am using the inappbrowser plugin in an ionic 2 application as follows:
import {InAppBrowser} from 'ionic-native';
and use it as follows:
launch(url){
this.browser = new InAppBrowser( url, "_blank", "EnableViewPortScale=yes,closebuttoncaption=Done" );
this.browser.on("exit")
.subscribe(
() => {
this.close_event=true;
},
err => {
console.log("InAppBrowser Loadstop Event Error: " + err);
});
}
and in html:
<button ion-button icon-right color="danger" (click)="launch('https://www.example.com')">launch
<ion-icon name="refresh"></ion-icon>
the first time you press the button launch buttonand after closing the browser it exit eventdoes not start, but when the second time click the start button and after closing the browser it exit eventwill be turned on
source
share