mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
Git pull made
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
/* eslint-disable */
|
||||
/* tslint:disable */
|
||||
///<reference path="../../../plugins/cordova-plugin-mfp/typings/worklight.d.ts" />
|
||||
/* ///<reference path="../../../plugins/cordova-plugin-mfp-push/typings/mfppush.d.ts" /> */
|
||||
import { Component, OnInit, NgZone } from '@angular/core';
|
||||
import { Event } from '../models/event.model';
|
||||
import { NotificationsService } from '../services/notifications.service';
|
||||
@@ -26,8 +24,6 @@ import { Storage } from '@ionic/storage';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx';
|
||||
|
||||
import { FirebaseX } from '@ionic-native/firebase-x/ngx';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
@@ -88,8 +84,7 @@ export class HomePage implements OnInit {
|
||||
private offlinemanager: OfflineManagerService,
|
||||
private storage: Storage,
|
||||
private eventservice: EventsService,
|
||||
private screenOrientation: ScreenOrientation,
|
||||
private firebaseX: FirebaseX) {
|
||||
private screenOrientation: ScreenOrientation) {
|
||||
|
||||
this.webNotificationPopupService.askNotificationPermission()
|
||||
|
||||
@@ -121,22 +116,11 @@ export class HomePage implements OnInit {
|
||||
|
||||
this.notificationsService.onReceviNotification();
|
||||
|
||||
this.firebaseX.getToken()
|
||||
.then(token => console.log(`The token is ${token}`)) // save the token server-side and use it to push notifications to this device
|
||||
.catch(error => console.error('Error getting token', error));
|
||||
|
||||
this.firebaseX.onMessageReceived()
|
||||
.subscribe(data => console.log(`User opened a notification ${data}`));
|
||||
|
||||
this.firebaseX.onTokenRefresh()
|
||||
.subscribe((token: string) => console.log(`Got a new token ${token}`));
|
||||
|
||||
window.addEventListener('online', () => {
|
||||
console.log('Became online')
|
||||
this.backgroundservice.online()
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
this.webnotification.webconnection();
|
||||
this.webnotification.register();
|
||||
} else {
|
||||
this.notificationsService.onReceviNotification();
|
||||
//this.mobilefirstConnect();
|
||||
@@ -160,45 +144,6 @@ export class HomePage implements OnInit {
|
||||
myWorker.postMessage('ali'); */
|
||||
}
|
||||
|
||||
/* mobilefirstConnect() {
|
||||
|
||||
console.log("Mobileconecct");
|
||||
|
||||
if (window['WLAuthorizationManager']) {
|
||||
if (window['WLAuthorizationManager'].obtainAccessToken) {
|
||||
window['WLAuthorizationManager'].obtainAccessToken("").then((token) => {
|
||||
|
||||
console.log('MobileFirst Server connect: Success ' + token);
|
||||
|
||||
var resourceRequest = new WLResourceRequest("/adapters/javaAdapter/resource/greet/",
|
||||
WLResourceRequest.GET
|
||||
);
|
||||
|
||||
resourceRequest.setQueryParameter("name", "world");
|
||||
resourceRequest.send().then(
|
||||
(response) => {
|
||||
// Will display "Hello world" in an alert dialog.
|
||||
console.log("Connect with JavaAdapter Success: " + response.responseText);
|
||||
//this.MFPushNotification();
|
||||
},
|
||||
(error) => {
|
||||
console.log("Connect with JavaAdapter Failure: " + JSON.stringify(error));
|
||||
}
|
||||
);
|
||||
}, (error) => {
|
||||
console.log('MobileFirst Server connect: failure ' + error.responseText);
|
||||
console.log(JSON.stringify(error))
|
||||
/* this.zone.run(() => {
|
||||
console.log("Bummer...");
|
||||
console.log("Failed to connect to MobileFirst Server");
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
} */
|
||||
|
||||
|
||||
|
||||
updateList() {
|
||||
|
||||
this.notificationsService.registerCallback(
|
||||
|
||||
Reference in New Issue
Block a user