mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
JsonStore added and Service created
This commit is contained in:
@@ -12,6 +12,7 @@ import { ModalController, AlertController, AnimationController, Platform } from
|
||||
import { NavigationExtras,Router } from '@angular/router';
|
||||
import { ToastService } from '../services/toast.service';
|
||||
import { Optional } from '@angular/core';
|
||||
import { JsonStore } from './jsonStore.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -31,7 +32,8 @@ export class NotificationsService {
|
||||
private router: Router,
|
||||
private toastService: ToastService,
|
||||
private zone: NgZone,
|
||||
private activeroute: ActivatedRoute) { }
|
||||
private activeroute: ActivatedRoute,
|
||||
private jsonstore: JsonStore) { }
|
||||
|
||||
getTokenByUserIdAndId(user, userID) {
|
||||
const geturl = environment.apiURL + 'notifications/user/' + userID;
|
||||
@@ -40,6 +42,7 @@ export class NotificationsService {
|
||||
}
|
||||
|
||||
getAndpostToken(username) {
|
||||
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
console.log('Notifications not supported')
|
||||
} else {
|
||||
@@ -109,6 +112,9 @@ export class NotificationsService {
|
||||
}
|
||||
);
|
||||
var notificationReceived = (message) => {
|
||||
this.jsonstore.createCollection('Notifications',message);
|
||||
this.jsonstore.getCollection('Notifications')
|
||||
console.log("Notification Store: ", this.jsonstore.getCollection('Notifications')[0]);
|
||||
console.log(message);
|
||||
var data = JSON.parse(message.payload);
|
||||
console.log(data.Service);
|
||||
|
||||
Reference in New Issue
Block a user