I want to make sure to launch inappbrowser only if I am on devices (iOs, Android...), but if I am in browser (local development mode or just a Web App with gulp build), I wa
The most reliable solution for me was a combination of at Platform's .is() method and its promise result. I used the check inside a provider, so I could use it globally. Maybe the approach is useful to someone who has exhausted the other paths.
import { Platform } from 'ionic-angular';
constructor(public platform: Platform) {
public env:string = 'dev';
this.platform.ready().then((readySource) => {
if (readySource) {
if (platform.is('core') || readySource.toLowerCase() !== 'cordova') {
this.env = 'dev';
}
else {
this.env = 'production';
}
}