When I list plugins (
cordova plugin list
Native: InAppBrowser is not installed or you are running on a browser. Falling back to window.open, all instance methods will NOT work.
cordova plugin add cordova-plugin-inappbrowser
InAppBrowser
Usage of ionic-native plugins must wait on the device being "ready"
For Ionic2 with Angular this can be achieved by importing Platform (with every thing else) to whichever component/service you plan on using the ionic-native plugin from.
import { Injectable } from '@angular/core';
import 'rxjs/add/operator/map';
import { InAppBrowser } from 'ionic-native';
import { Platform } from 'ionic-angular';
and then waiting on the platform being ready:
@Injectable()
export class Service() {
constructor(public platform: Platform) {
this.init()
}
init() {
this.platform.ready().then(() => {
let browser = new InAppBrowser('https://ionic.io', '_system');
browser.on("loadstop").subscribe(()=> console.log("loadstop"));
});
}
}