How to use the ionic-native.Device.platform function in ionic-native

To help you get started, we’ve selected a few ionic-native examples, based on popular ways it is used in public projects.

github Backendless / JS-SDK / examples / messaging-service / push-notification / ionic-2 / src / app / app.component.ts View on Github external
initPushNotification() {
    if (!this.platform.is('cordova')) {
      console.warn("Push notifications not initialized. Cordova is not available - Run in physical device");
      return;
    }

    Backendless.setupDevice({
      uuid: Device.uuid,
      platform: Device.platform,
      version: Device.version
    });

    let push = Push.init({
      android: {
        senderID: "YOUR_SENDER_ID"
      },
      ios: {
        alert: "true",
        badge: false,
        sound: "true"
      },
      windows: {}
    });

    push.on('registration', (data) => {
github NorthMcCormick / Polyonic / src / src / pages / page1 / page1.ts View on Github external
ready() {

    console.log('Device from app: ', Device);

    this.version = Device.version;
    this.deviceModel = Device.model;
    this.dplatform = Device.platform;

    AppVersion.getVersionNumber().then((value) => {
      this.appVersion = value;
      console.log(value);
    }, (error) => {
      console.error(error);
    })

    AppVersion.getPackageName().then((value) => {
      this.appPackageName = value;
      console.log(value);
    }, (error) => {
      console.error(error);
    })

    AppVersion.getAppName().then((value) => {
github apppresser / ap3 / src / pages / post-list / post-list.ts View on Github external
previewAlert(url) {

    if( Device.platform != 'iOS' && Device.platform != 'Android' && url.indexOf('http://') >= 0 ) {
          alert('Cannot display http pages in browser preview. Please build app for device or use https.');
      }

  }
github crabcanon / angular2-ionic2-demo / src / providers / native-service.ts View on Github external
getDeviceInfo() {
    this.deviceInfo = {
      uuid: Device.uuid,
      cordova: Device.cordova,
      model: Device.model,
      platform: Device.platform,
      version: Device.version,
      manufacturer: Device.manufacturer,
      isVirtual: Device.isVirtual,
      serial: Device.serial
    };
    return this.deviceInfo;
  }