Skip to content

Instantly share code, notes, and snippets.

@c-goosen
Created December 29, 2017 13:58
Show Gist options
  • Save c-goosen/633d70c8ca3381247e854290aec8b4cc to your computer and use it in GitHub Desktop.
Save c-goosen/633d70c8ca3381247e854290aec8b4cc to your computer and use it in GitHub Desktop.
Disabling Ionic-Native plugins that won't work in ionic cordova emulate browser or ionic serve
//I import isApp on App start to detect whether or not its running in a browser.
// Useful during development.
// Usually works best with cordova platform browser
// ionic cordova platform add browser
// ionic cordova emulate browser -cl
// import { Platform } from 'ionic-angular/platform';
// import { IsDebug } from '@ionic-native/is-debug';
// TODO: Add more settings, detect cordova or not
console.log("\nSettings Being Loaded\n");
// development on browser
export var isApp = !(!document.URL.startsWith('http') || document.URL.startsWith('http://localhost:8080'));
console.log("Ionic Running as App: " + isApp.toString());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment