mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Notification solved
This commit is contained in:
@@ -15,6 +15,7 @@ import { v4 as uuidv4 } from 'uuid';
|
||||
import { EventTrigger } from '../services/eventTrigger.service';
|
||||
import { SessionStore } from '../store/session.service';
|
||||
import { ActionPerformed, PushNotificationSchema, PushNotifications, Token, } from '@capacitor/push-notifications';
|
||||
/* import { Events } from 'ionic-angular' */
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -44,6 +45,7 @@ export class NotificationsService {
|
||||
private activeroute: ActivatedRoute,
|
||||
private eventtrigger: EventTrigger,
|
||||
private backgroundservice: BackgroundService,
|
||||
/* private eventTriger: Events, */
|
||||
/* private fcm: FCM */) {
|
||||
|
||||
this.storageService.get("Notifications").then((value) => {
|
||||
@@ -147,9 +149,19 @@ export class NotificationsService {
|
||||
PushNotifications.addListener('pushNotificationReceived',
|
||||
(notification: PushNotificationSchema) => {
|
||||
console.log(notification)
|
||||
this.DataArray.push(notification)
|
||||
//this.DataArray.push(notification)
|
||||
//console.log(this.DataArray)
|
||||
|
||||
this.storageService.get("Notifications").then((store) => {
|
||||
store.push(notification)
|
||||
this.storageService.store("Notifications", store)
|
||||
}).catch((error) => {
|
||||
if(!error) {
|
||||
this.storageService.store("Notifications", [notification])
|
||||
}
|
||||
})
|
||||
|
||||
this.storageService.store("Notifications", this.DataArray)
|
||||
/* this.eventTriger.publish('notificatioRecive') */
|
||||
this.eventtrigger.publishSomeData({
|
||||
notification: "recive"
|
||||
})
|
||||
@@ -172,7 +184,7 @@ export class NotificationsService {
|
||||
);
|
||||
}
|
||||
|
||||
tempClearArray() {
|
||||
tempClearArray(data) {
|
||||
this.DataArray = new Array;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user