mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Notification on perfil menu
This commit is contained in:
+34
-31
@@ -8,10 +8,11 @@ import { Event } from '../models/event.model';
|
||||
import { ProcessesService } from '../services/processes.service';
|
||||
import { NotificationsService } from '../services/notifications.service';
|
||||
import { ModalController, AlertController, AnimationController, Platform } from '@ionic/angular';
|
||||
import { NavigationExtras,Router,ActivatedRoute } from '@angular/router';
|
||||
import { NavigationExtras, Router, ActivatedRoute } from '@angular/router';
|
||||
import { ToastService } from '../services/toast.service';
|
||||
import { ToDayEventStorage } from '../store/to-day-event-storage.service';
|
||||
|
||||
|
||||
// import * as Sentry from "@sentry/browser";
|
||||
// import { Integrations } from "@sentry/tracing";
|
||||
|
||||
@@ -68,7 +69,7 @@ export class HomePage implements OnInit {
|
||||
public modalCtrl: AlertController,
|
||||
private notificatinsservice: NotificationsService,
|
||||
private platform: Platform,
|
||||
private activeroute: ActivatedRoute) {
|
||||
private activeroute: ActivatedRoute,) {
|
||||
|
||||
this.router.events.subscribe((val) => {
|
||||
document.querySelectorAll('ion-modal').forEach((e: any) => e.remove())
|
||||
@@ -81,46 +82,48 @@ export class HomePage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
console.log('Active route ',this.router.url)
|
||||
if(this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
|
||||
console.log('Active route ', this.router.url)
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
console.log('Notifications not supported')
|
||||
} else {
|
||||
this.mobilefirstConnect();
|
||||
this.notificatinsservice.onReceviNotification();
|
||||
this.mobilefirstConnect();
|
||||
this.notificatinsservice.getAndpostToken2();
|
||||
this.notificatinsservice.onReceviNotification();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
mobilefirstConnect() {
|
||||
|
||||
|
||||
window['WLAuthorizationManager'].obtainAccessToken("").then( (token) => {
|
||||
|
||||
console.log('MobileFirst Server connect: Success ' + token);
|
||||
window['WLAuthorizationManager'].obtainAccessToken("").then((token) => {
|
||||
|
||||
var resourceRequest = new WLResourceRequest("/adapters/javaAdapter/resource/greet/",
|
||||
WLResourceRequest.GET
|
||||
);
|
||||
console.log('MobileFirst Server connect: Success ' + token);
|
||||
|
||||
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) => {
|
||||
alert("Connect with JavaAdapter Failure: " + JSON.stringify(error));
|
||||
}
|
||||
);
|
||||
}, (error) => {
|
||||
console.log('MobileFirst Server connect: failure ' + error.responseText);
|
||||
console.log(JSON.stringify(error))
|
||||
/* this.zone.run(() => {
|
||||
alert("Bummer...");
|
||||
alert("Failed to connect to MobileFirst Server");
|
||||
}); */
|
||||
});
|
||||
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) => {
|
||||
alert("Connect with JavaAdapter Failure: " + JSON.stringify(error));
|
||||
}
|
||||
);
|
||||
}, (error) => {
|
||||
console.log('MobileFirst Server connect: failure ' + error.responseText);
|
||||
console.log(JSON.stringify(error))
|
||||
/* this.zone.run(() => {
|
||||
alert("Bummer...");
|
||||
alert("Failed to connect to MobileFirst Server");
|
||||
}); */
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user