Example #1
0
 show(message = '') {
   if (this.platform.is('cordova')) {
     this.toastNative.show(message, `${TOAST_DURATION}`, this.config.getToast('position', TOAST_POSITION)).subscribe();
   } else {
     this.toastCtrl.create({
       message,
       duration: this.config.getToast('duration', TOAST_DURATION)
     }).present();
   }
 }
Example #2
0
    /**
     * opens the url with the system app if installed or in the browser
     * @param url url of the website
     */
    openYouTube(url) {
        let app;
        if (this.platform.is('ios')) {
            app = 'youtube://';
        }
        else if (this.platform.is('android')) {
            app = 'com.google.android.youtube';
        }

        AppAvailability.check(app).then(
            function () {  // Success callback
                open(url, '_system', 'location=no');
                console.log('YouTube is available');
            },
            function () {  // Error callback
                open(url, '_system', 'location=no');
                console.log('YouTube is not available');
            });
    }
Example #3
0
  private initializeApp(): void {
    this.platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.

      // https://github.com/lathonez/clicker/issues/148#issuecomment-254436635
      // StatusBar.styleDefault();
      console.log('production: ' + environment.production);
    });
  }
Example #4
0
    /**
     * opens the url with the system app if installed or in the browser
     * @param url url of the website
     */
    openTwitter(url) {
        let app;
        if (this.platform.is('ios')) {
            app = 'twitter://';
        }
        else if (this.platform.is('android')) {
            app = 'com.twitter.android';
        }

        AppAvailability.check(app).then(
            function () {  // Success callback
                open(url, '_system', 'location=no');
                console.log('Twitter is available');
            },
            function () {  // Error callback
                open(url, '_system', 'location=no');
                console.log('Twitter is not available');
            });
    }
Example #5
0
    /**
     * opens the url with the system app if installed or in the browser
     * @param url url of the website
     */
    openFacebook(url) {
        let app;
        if (this.platform.is('ios')) {
            app = 'fb://';
        }
        else if (this.platform.is('android')) {
            app = 'com.facebook.katana';
        }

        AppAvailability.check(app).then(
            function () {  // Success callback
                open('fb://page/' + url, '_system', 'location=no');
                console.log('Facebook is available');
            },
            function () {  // Error callback
                open('https://www.facebook.com/' + url, '_system', 'location=no');
                console.log('Facebook is not available');
            });
    }
Example #6
0
 ngOnInit() {
   //console.dir(this.el.nativeElement.attributes);
   if(this.color === 'light' && this.platform.is('ios')){
     this.color = 'primary'
     this.el.nativeElement.style.color = `var(--color-${this.color})`;
   }else{
     this.el.nativeElement.style.color = `var(--color-${this.color})`;
   }
   
 }
Example #7
0
    constructor(nav:NavController, platform:Platform) {
        this.nav = nav;


        platform.ready().then(() => {


        });

    }
 createDeleteButton(message, handler) {
   
   return {
       text: this.translate.instant(message),
       role: 'destructive',
       icon: !this.platform.is('ios') ? 'trash' : null,
       cssClass: 'WorkoutAction-delete',
       handler
   } 
 }
Example #9
0
  initializeApp() {
    this.platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      StatusBar.styleDefault();

      //Initialize facebook
      this.authProvider.initFacebook();
    });
  }
    constructor(platform: Platform)
    {

        this.policy = "Privacy policy";
        this.policyURL = "https://s3.priority-software.com/terms/master_privacy_policy.pdf";
        if (platform.is("ios"))
            this.termsURL = "https://s3.priority-software.com/terms/master_termsofuse_appstore.pdf";
        else
            this.termsURL = "https://s3.priority-software.com/terms/master_termsofuse_googleplay.pdf";
    }
    createCancelButton() {

        return  {
            text: this.translate.instant('WORKOUT_TEMPLATE_ACTIONS_CANCEL'),
            role: 'cancel',
            cssClass: 'WorkoutAction-cancel',
            icon:  !this.platform.is('ios') ? 'close' : null,
            handler: () => {}
        }
    }
Example #12
0
 constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen,
   public storage: Storage) {
   platform.ready().then(() => {
     // Okay, so the platform is ready and our plugins are available.
     // Here you can do any higher level native things you might need.
     statusBar.styleDefault();
     splashScreen.hide();
     this.storage.get("logged").then(value=>this.rootPage = value? HomePage: LoginPage);
   });
 }
    ionViewDidEnter() {
	
        /* Set the amount of total steps currently in storage */
	this.totalSteps = this.bl.getStepCount();
	
        /* Start up the data relay */
        this.platform.ready().then(() => {
            this.connect();
        });
    }
Example #14
0
 constructor(
   public navCtrl: NavController,
   public navParams: NavParams,
   public viewCtrl: ViewController,
   private alertCtrl: AlertController,
   private toastCtrl: ToastController,
   private calendar: Calendar,
   private platform: Platform) {
   this.platform.ready().then(() => console.log('Platform is ready for calendar.'));
 }
Example #15
0
 constructor(
   private platform: Platform,
   private storage: Storage,
   private http: Http,
   private xmlUtil: XMLUtility,
   private fileUtil: FileUtility,
   private toastCtrl: ToastController
 ) {
   this.platform.ready().then(() => (this.x2js = new X2JS()));
 }
Example #16
0
        }).catch(e => {                 
          let alert = this.alertCtrl.create({
                  title: 'Fatal Error!',
                  subTitle: 'Unable to get service end-point.  Please contact admin.',
                  buttons: ['OK']
                });
          alert.present();
          platform.exitApp();

        });
Example #17
0
  constructor(private platform: Platform) {
    this.rootPage = TabsPage;

    platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      StatusBar.styleDefault();
      document.getElementById("loading").style.display = 'none';
    });
  }
Example #18
0
  constructor(private platform: Platform) {
    this.rootPage = HomePage;
    // this.rootPage = MapPage;

    platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      StatusBar.styleDefault();
    });
  }
Example #19
0
 initializeApp() {
   this.platform.ready().then(() => {
     // Okay, so the platform is ready and our plugins are available.
     // Here you can do any higher level native things you might need.
     this.splashScreen.show();
     this.statusBar.styleDefault();
     // this.AroundMe.getSales(0);
     this.splashScreen.hide();
   });
 }
    constructor(platform: Platform, pushNotificationsProvider: AddonPushNotificationsProvider, eventsProvider: CoreEventsProvider,
            localNotificationsProvider: CoreLocalNotificationsProvider, loggerProvider: CoreLoggerProvider,
            updateManager: CoreUpdateManagerProvider, cronDelegate: CoreCronDelegate,
            registerCronHandler: AddonPushNotificationsRegisterCronHandler,
            unregisterCronHandler: AddonPushNotificationsUnregisterCronHandler) {

        const logger = loggerProvider.getInstance('AddonPushNotificationsModule');

        // Register the handlers.
        cronDelegate.register(registerCronHandler);
        cronDelegate.register(unregisterCronHandler);

        // Register device on GCM or APNS server.
        platform.ready().then(() => {
            pushNotificationsProvider.registerDevice();
        });

        eventsProvider.on(CoreEventsProvider.NOTIFICATION_SOUND_CHANGED, () => {
            // Notification sound has changed, register the device again to update the sound setting.
            pushNotificationsProvider.registerDevice();
        });

        // Register device on Moodle site when login.
        eventsProvider.on(CoreEventsProvider.LOGIN, () => {
            pushNotificationsProvider.registerDeviceOnMoodle().catch((error) => {
                logger.warn('Can\'t register device', error);
            });
        });

        eventsProvider.on(CoreEventsProvider.SITE_DELETED, (site) => {
            pushNotificationsProvider.unregisterDeviceOnMoodle(site).catch((error) => {
                logger.warn('Can\'t unregister device', error);
            });
            pushNotificationsProvider.cleanSiteCounters(site.id);
        });

        // Listen for local notification clicks (generated by the app).
        localNotificationsProvider.registerClick(AddonPushNotificationsProvider.COMPONENT,
            pushNotificationsProvider.notificationClicked.bind(pushNotificationsProvider));

        // Allow migrating the table from the old app to the new schema.
        updateManager.registerAppTableMigration({
            name: 'mma_pushnotifications_badge',
            newName: AddonPushNotificationsProvider.BADGE_TABLE,
            fields: [
                {
                    name: 'siteid',
                    newName: 'siteId'
                }
            ]
        });

        // Migrate the component name.
        updateManager.registerLocalNotifComponentMigration('mmaPushNotifications', AddonPushNotificationsProvider.COMPONENT);
    }
 login() {
   if (this.platform.is('cordova')) {
     Facebook.login(['email']).then(
       response => this.angularFireAuth(response.authResponse.accessToken),
       error => alert(`Facebook login failed. Error: ${JSON.stringify(error)}`)
     );
   }
   else { // If we aren't in native environment where FB login works, use localStorage-stored value for token
     this.angularFireAuth(localStorage.getItem('FACEBOOK_ACCESS_TOKEN'));
   }
 }
Example #22
0
  constructor(platform: Platform, nav: NavController, mapsService: MapsService) {

    this.nav = nav;
    this.mapsService = mapsService;
    this.loading = this._createLoading();
    this.isWatching = false;

    platform.ready().then(() => {
      this.map = mapsService.getMap('map');
    });
  }
Example #23
0
  async setChannel(channel: string) {
    await this.platform.ready();
    this.settings.channel = channel;

    await this.hasDeploy();

    return this.pro.deploy().init({
      appId: APP_ID,
      channel,
    });
  }
Example #24
0
 constructor(private platform: Platform, private navCtrl: NavController) {
     platform.ready().then(() => {
         console.log("Home ready");
         let options = {
             name: 'todo.db'
             //iosDatabaseLocation: 'default'
         }
         this.storage = new Storage(SqlStorage, options);
         this.refresh();
     });
 }
Example #25
0
  constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
     if(window.localStorage.getItem("token")){
      this.rootPage = PersonalPage;
    }else{
      this.rootPage = TabsPage;
    }
    if(platform.is("android")){
      window.localStorage.setItem("platform", "android");
    }
    if(platform.is("ios")){
      window.localStorage.setItem("platform", "ios");
    }

    platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      statusBar.styleDefault();
      splashScreen.hide();
    });
  }
Example #26
0
  constructor(private platform:Platform, public menu:MenuController) {
    this.rootPage = EcommerceHomePage;
    this.tabspage = TabsPage;
    this.hellopage = HellopagePage;

    platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      StatusBar.styleDefault();
    });
  }
 .subscribe(updateAlertType => {
   this._platform.ready().then(() => {
     if (this._alert) {
       this._alert.dismiss();
     }
     this._alert = this._createAlert(updateAlertType);
     if (this._alert) {
       this._alert.present();
     }
   });
 });
    /**
     * Checks if the location is enabled (promise resolved) or disabled (promise rejected)
     * @return {Promise<any>}
     */
    public requestLocation(): Promise<any> {
        return this.platform.ready().then(() => {
            return this.locationAccuracyPlugin.canRequest().then(canRequest => {
                if (!canRequest) {
                    return Promise.resolve();
                }

                return this.locationAccuracyPlugin.request(this.locationAccuracyPlugin.REQUEST_PRIORITY_HIGH_ACCURACY);
            });
        });
    }
  initializeMap() {
    this.platform.ready().then(() => {
      var minZoomLevel = 12;

      this.map = new google.maps.Map(document.getElementById('map_canvas'), {
               zoom: minZoomLevel,
               center: new google.maps.LatLng(38.50, -90.50),
               mapTypeId: google.maps.MapTypeId.ROADMAP
           });
    });
  }
 	//add begins here
 add() {
 	this.platform.ready().then(()=>{
 		this.storage.query("INSERT INTO people (firstname, lastname, city) VALUES('" + this.input_firstname + "' , '" + this.input_lastname + "' , '" + this.input_city + "')")
 		.then((data)=>{
 			console.log(JSON.stringify(data.res));
 			console.log("successfully added");
 		}, (error)=>{
 			console.log("There was an error: " + JSON.stringify(error.error));
 		});
 	});
 }