@kolektor/nucleus-notifications 0.0.12-pre.7919 → 0.1.0-pre.124

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,412 +0,0 @@
1
- import { __awaiter } from 'tslib';
2
- import * as i0 from '@angular/core';
3
- import { Injectable, NgModule } from '@angular/core';
4
- import { PushNotifications } from '@capacitor/push-notifications';
5
- import { Subject, of } from 'rxjs';
6
- import * as i1 from '@angular/common/http';
7
- import * as i2 from '@angular/service-worker';
8
- import * as i3 from '@kolektor/nucleus-common';
9
-
10
- class Notification {
11
- }
12
- class Identity {
13
- }
14
- class Recipient {
15
- }
16
- class NotificationData {
17
- }
18
- class WebKey {
19
- }
20
- class Registration {
21
- }
22
- class RegistrationResult {
23
- }
24
- class PayloadData {
25
- }
26
- class NucleusNotificationsConfig {
27
- }
28
- class NotificationClick {
29
- }
30
- class UserChannelConfig {
31
- }
32
-
33
- class NucleusNotificationsService {
34
- constructor(http, swPush, appService, config) {
35
- this.http = http;
36
- this.swPush = swPush;
37
- this.appService = appService;
38
- this.apiUrl = null;
39
- this.registrationStorageKey = 'NucleusNotificationsRegistrationId';
40
- this.notificationsStorageKey = 'NucleusNotificationsLocalCache';
41
- this._isInitialized = false;
42
- this._newNotifications = new Subject();
43
- this._clicksSubject = new Subject();
44
- this._stateChangesSubject = new Subject();
45
- this.notifications = [];
46
- let url = config.serverApiUrl;
47
- if (!url.endsWith('/')) {
48
- url += '/';
49
- }
50
- this.apiUrl = url;
51
- }
52
- get unreadCount() {
53
- return this.notifications.filter(x => !x.isRead).length;
54
- }
55
- get newNotifications() {
56
- return this._newNotifications.asObservable();
57
- }
58
- get clicks() {
59
- return this._clicksSubject.asObservable();
60
- }
61
- get stateChanges() {
62
- return this._stateChangesSubject.asObservable();
63
- }
64
- get isInitialized() {
65
- return this._isInitialized;
66
- }
67
- initialize() {
68
- return __awaiter(this, void 0, void 0, function* () {
69
- // make sure app service has finished initializing
70
- yield this.appService.init();
71
- this.loadFromStorage();
72
- if (this.appService.isNative) {
73
- this._platform = this.appService.deviceInfo.platform;
74
- yield this.registerCapacitorEvents();
75
- }
76
- else if (this.swPush.isEnabled) {
77
- this._platform = 'web';
78
- this.registerWebPushEvents();
79
- }
80
- else {
81
- console.warn('Nucleus.Notifications: There is no push capability, timer will be used to update notifications');
82
- setInterval(() => {
83
- console.log('Updating notifications...');
84
- this.refresh(true);
85
- }, 5 * 60 * 1000);
86
- }
87
- this._isInitialized = true;
88
- this.refresh();
89
- });
90
- }
91
- register() {
92
- return new Promise((_resolve, _reject) => {
93
- this.getRegistrationInfo().then((info) => {
94
- this.http.post(this.apiUrl + 'registration', info).subscribe((regResult) => {
95
- window.localStorage.setItem(this.registrationStorageKey, regResult.id);
96
- _resolve(null);
97
- }, error => {
98
- console.log('Nucleus.Notifications: Failed to send notification registration to server.', error);
99
- _reject(error);
100
- });
101
- }).catch((error) => _reject(error));
102
- });
103
- }
104
- unregister() {
105
- return new Promise((_resolve, _reject) => {
106
- this.getRegistrationInfo().then((info) => {
107
- this.http.request('DELETE', this.apiUrl + 'registration', { body: info }).subscribe(() => {
108
- window.localStorage.removeItem(this.registrationStorageKey);
109
- _resolve(null);
110
- }, error => {
111
- console.log('Nucleus.Notifications: Failed to remove registration from server.', error);
112
- _reject(error);
113
- });
114
- }).catch((error) => _reject(error));
115
- });
116
- }
117
- refresh(notifyAboutNew = false) {
118
- this.http.get(this.apiUrl + 'notifications').subscribe(res => {
119
- this.updateNotifications(res, notifyAboutNew);
120
- });
121
- }
122
- getNotification(id) {
123
- const localNotification = this.notifications.find(x => x.id === id);
124
- if (localNotification) {
125
- return of(localNotification);
126
- }
127
- return this.http.get(this.apiUrl + 'notifications/' + id);
128
- }
129
- readNotification(id) {
130
- const n = this.notifications.find(x => x.id === id);
131
- if (n && !n.isRead) {
132
- n.isRead = true;
133
- this.notifyStateChanged();
134
- }
135
- this.http.get(this.apiUrl + 'notifications/read/' + id).subscribe();
136
- }
137
- dismissNotification(id) {
138
- this.deleteNotificaton(id);
139
- this.http.delete(this.apiUrl + 'notifications/' + id).subscribe();
140
- this.removeDeliveredNotification(id);
141
- }
142
- dismissAll() {
143
- this.notifications.splice(0);
144
- this.notifyStateChanged();
145
- this.http.delete(this.apiUrl + 'notifications/all').subscribe();
146
- if (this._platform === 'ios' || this._platform === 'android') {
147
- PushNotifications.removeAllDeliveredNotifications();
148
- }
149
- else if (this._platform === 'web') {
150
- // TODO: remove all web push notifications
151
- }
152
- }
153
- readAll() {
154
- for (const n of this.notifications) {
155
- n.isRead = true;
156
- }
157
- this.notifyStateChanged();
158
- this.http.get(this.apiUrl + 'notifications/read/all').subscribe();
159
- }
160
- getChannelConfig(senderId, channelId, language = null) {
161
- return this.http.get(this.apiUrl + `settings/channel/${senderId}/${channelId}?language=${language}`);
162
- }
163
- getChannelConfigsForSender(senderId, channelIds, language = null) {
164
- const idsStr = channelIds.map(x => senderId + ',' + x).join(';');
165
- return this.getChannelConfigsInternal(idsStr, language);
166
- }
167
- getChannelConfigs(ids, language = null) {
168
- const idsStr = ids.map(x => x.senderId + ',' + x.channelId).join(';');
169
- return this.getChannelConfigsInternal(idsStr, language);
170
- }
171
- setChannelConfig(senderId, config) {
172
- return this.http.post(`${this.apiUrl}settings/channel/${senderId}`, config);
173
- }
174
- setChannelConfigs(configs) {
175
- return this.http.post(`${this.apiUrl}settings/channels`, configs);
176
- }
177
- getChannelConfigsInternal(ids, language) {
178
- return this.http.get(`${this.apiUrl}settings/channels?ids=${ids}&language=${language}`);
179
- }
180
- updateNotifications(newNotifications, notifyAboutNew = false) {
181
- let stateChanged = false;
182
- for (const n of newNotifications) {
183
- const existing = this.notifications.find(x => x.id === n.id);
184
- if (existing) {
185
- if (existing.isRead !== n.isRead) {
186
- existing.isRead = n.isRead;
187
- stateChanged = true;
188
- }
189
- }
190
- else {
191
- let i = 0;
192
- while (i < this.notifications.length && n.dateCreated < this.notifications[i].dateCreated) {
193
- i++;
194
- }
195
- this.notifications.splice(i, 0, n);
196
- stateChanged = true;
197
- if (notifyAboutNew) {
198
- this._newNotifications.next(n);
199
- }
200
- }
201
- }
202
- const now = Date.now();
203
- for (let i = this.notifications.length - 1; i >= 0; i--) {
204
- const n = this.notifications[i];
205
- if (new Date(n.expirationDate).getTime() < now || !newNotifications.find(x => x.id === n.id)) {
206
- this.notifications.splice(i, 1);
207
- stateChanged = true;
208
- }
209
- }
210
- if (stateChanged) {
211
- this.notifyStateChanged();
212
- }
213
- }
214
- saveToStorage() {
215
- const str = JSON.stringify(this.notifications);
216
- window.localStorage.setItem(this.notificationsStorageKey, str);
217
- }
218
- loadFromStorage() {
219
- try {
220
- const str = window.localStorage.getItem(this.notificationsStorageKey);
221
- if (str) {
222
- const notifications = JSON.parse(str);
223
- this.notifications = notifications.filter(x => !!x);
224
- // precaution for notification.isRead of undefined error
225
- this.notifyStateChanged(false);
226
- }
227
- }
228
- catch (_a) { }
229
- }
230
- handleNotificationEvent(id, eventType) {
231
- if (eventType.startsWith('new') || eventType === 'updated') { // we are handling new and newSilent
232
- this.getNotification(id).subscribe(n => {
233
- if (eventType.startsWith('new') && !n.isRead) {
234
- this._newNotifications.next(n);
235
- }
236
- const existing = this.notifications.find(x => x.id === n.id);
237
- if (existing) {
238
- existing.isRead = n.isRead;
239
- }
240
- else {
241
- this.notifications.splice(0, 0, n);
242
- }
243
- this.notifyStateChanged();
244
- });
245
- }
246
- else if (eventType === 'deleted') {
247
- this.deleteNotificaton(id);
248
- }
249
- else {
250
- this.refresh();
251
- }
252
- }
253
- deleteNotificaton(id) {
254
- const i = this.notifications.findIndex(x => x.id === id);
255
- if (i >= 0) {
256
- this.notifications.splice(i, 1);
257
- this.notifyStateChanged();
258
- }
259
- }
260
- notifyStateChanged(persistState = true) {
261
- if (persistState) {
262
- this.saveToStorage();
263
- }
264
- this._stateChangesSubject.next();
265
- }
266
- handleNotificationAction(notificationAction) {
267
- const arr = notificationAction.split(':');
268
- const notificationClick = {
269
- id: arr[0],
270
- type: arr[1],
271
- routerLink: arr[2]
272
- };
273
- const validNotificationClickTypes = ['default', 'deeplink'];
274
- if (validNotificationClickTypes.includes(notificationClick.type)) {
275
- this._clicksSubject.next(notificationClick);
276
- }
277
- else {
278
- console.error(`Nucleus.Notifications: Unknown notification action: '${notificationAction}'.`);
279
- }
280
- }
281
- removeDeliveredNotification(id) {
282
- if (this._platform === 'ios' || this._platform === 'android') {
283
- PushNotifications.getDeliveredNotifications().then(list => {
284
- const toRemove = list.notifications.filter(n => {
285
- const data = this.getNotificationPayloadData(n);
286
- return (data.notificationId === id);
287
- });
288
- // TODO: On Android this does not currently work because notificationID is not set.
289
- // This my solve the issue: https://github.com/ionic-team/capacitor/pull/3523
290
- PushNotifications.removeDeliveredNotifications({
291
- notifications: toRemove
292
- });
293
- });
294
- }
295
- else if (this._platform === 'web') {
296
- // TODO: remove web push notification
297
- }
298
- }
299
- getNotificationPayloadData(pushNotification) {
300
- return (this._platform === 'ios') ? pushNotification.data.data : pushNotification.data;
301
- }
302
- registerCapacitorEvents() {
303
- return __awaiter(this, void 0, void 0, function* () {
304
- yield PushNotifications.addListener('pushNotificationReceived', n => {
305
- const data = this.getNotificationPayloadData(n);
306
- console.log('Nucleus.Notifications: Received capacitor push event: ' + data.eventType, n);
307
- this.handleNotificationEvent(data.notificationId, data.eventType);
308
- });
309
- yield PushNotifications.addListener('pushNotificationActionPerformed', a => {
310
- let action = a.notification.data.notificationAction;
311
- if (this._platform === 'ios') {
312
- action = a.notification.data.data.notificationAction;
313
- }
314
- console.log('Nucleus.Notifications: Received capacitor action event', action);
315
- this.handleNotificationAction(action);
316
- });
317
- });
318
- }
319
- registerWebPushEvents() {
320
- this.swPush.messages.subscribe((n) => {
321
- const data = n.data;
322
- console.log('Nucleus.Notifications: Received WebPush event: ' + data.eventType, n);
323
- this.handleNotificationEvent(data.notificationId, data.eventType);
324
- });
325
- this.swPush.notificationClicks.subscribe((action) => {
326
- console.log('Nucleus.Notifications: Received WebPush action event', action);
327
- const tag = action.notification.tag;
328
- this.handleNotificationAction(tag);
329
- });
330
- }
331
- getRegistrationInfo() {
332
- return new Promise((_resolve, _reject) => {
333
- const registrationId = window.localStorage.getItem(this.registrationStorageKey);
334
- if (this._platform === 'android' || this._platform === 'ios') {
335
- // capacitor platform
336
- const listener = PushNotifications.addListener('registration', token => {
337
- listener.remove();
338
- _resolve({ id: registrationId, token: token.value, platform: this._platform });
339
- });
340
- PushNotifications.register().catch(error => _reject('Could not register for notifications:' + error));
341
- }
342
- else if (this._platform === 'web') {
343
- // Web Push API
344
- this.http.get(this.apiUrl + 'registration/webkey').subscribe(key => {
345
- this.getWebPushSubscription(key.publicKey).then(subscription => {
346
- const t = JSON.stringify(subscription.toJSON());
347
- _resolve({ id: registrationId, token: t, platform: 'web' });
348
- });
349
- }, error => _reject(error));
350
- }
351
- else {
352
- _reject(`Nucleus.Notifications: Platform is not supported`);
353
- }
354
- });
355
- }
356
- getWebPushSubscription(publicKey) {
357
- return new Promise((_resolve, _reject) => {
358
- this.swPush.subscription.subscribe(subscription => {
359
- if (subscription != null) {
360
- _resolve(subscription);
361
- }
362
- else {
363
- this.swPush.requestSubscription({ serverPublicKey: publicKey }).then(s => _resolve(s)).catch(e => _reject(e));
364
- }
365
- }, error => {
366
- console.error('Nucleus.Notifications: Cannot get web push subscription', error);
367
- _reject(error);
368
- });
369
- });
370
- }
371
- }
372
- NucleusNotificationsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NucleusNotificationsService, deps: [{ token: i1.HttpClient }, { token: i2.SwPush }, { token: i3.NucleusAppService }, { token: NucleusNotificationsConfig }], target: i0.ɵɵFactoryTarget.Injectable });
373
- NucleusNotificationsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NucleusNotificationsService, providedIn: 'root' });
374
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NucleusNotificationsService, decorators: [{
375
- type: Injectable,
376
- args: [{
377
- providedIn: 'root'
378
- }]
379
- }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i2.SwPush }, { type: i3.NucleusAppService }, { type: NucleusNotificationsConfig }]; } });
380
-
381
- class NucleusNotificationsModule {
382
- static forRoot(config) {
383
- return {
384
- ngModule: NucleusNotificationsModule,
385
- providers: [
386
- { provide: NucleusNotificationsConfig, useValue: config }
387
- ]
388
- };
389
- }
390
- }
391
- NucleusNotificationsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NucleusNotificationsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
392
- NucleusNotificationsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: NucleusNotificationsModule });
393
- NucleusNotificationsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NucleusNotificationsModule });
394
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: NucleusNotificationsModule, decorators: [{
395
- type: NgModule,
396
- args: [{
397
- declarations: [],
398
- imports: [],
399
- exports: []
400
- }]
401
- }] });
402
-
403
- /*
404
- * Public API Surface of nucleus-notifications
405
- */
406
-
407
- /**
408
- * Generated bundle index. Do not edit.
409
- */
410
-
411
- export { Identity, Notification, NotificationClick, NotificationData, NucleusNotificationsConfig, NucleusNotificationsModule, NucleusNotificationsService, PayloadData, Recipient, Registration, RegistrationResult, UserChannelConfig, WebKey };
412
- //# sourceMappingURL=kolektor-nucleus-notifications.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"kolektor-nucleus-notifications.mjs","sources":["../../../projects/nucleus-notifications/src/lib/models.ts","../../../projects/nucleus-notifications/src/lib/nucleus-notifications.service.ts","../../../projects/nucleus-notifications/src/lib/nucleus-notifications.module.ts","../../../projects/nucleus-notifications/src/public-api.ts","../../../projects/nucleus-notifications/src/kolektor-nucleus-notifications.ts"],"sourcesContent":["export class Notification {\r\n public id: string;\r\n public sender: Identity;\r\n public data: NotificationData;\r\n public isRead: boolean;\r\n public dateCreated: Date;\r\n public expirationDate: Date;\r\n}\r\n\r\nexport class Identity {\r\n public subject: string;\r\n public name: string;\r\n public pictureUrl: string;\r\n}\r\n\r\nexport class Recipient {\r\n public attributeName: string;\r\n public directoryName: string;\r\n public attributeValue: string;\r\n}\r\n\r\nexport class NotificationData {\r\n title: string;\r\n message: string;\r\n htmlMessage: string;\r\n preventDismissal: boolean;\r\n deepLink: string;\r\n}\r\n\r\nexport class WebKey {\r\n publicKey: string;\r\n}\r\n\r\nexport class Registration {\r\n id: string;\r\n token: string;\r\n platform: PlatformValue;\r\n}\r\n\r\nexport class RegistrationResult {\r\n id: string;\r\n}\r\n\r\nexport class PayloadData {\r\n notificationId: string;\r\n eventType: NotificationEventType;\r\n}\r\n\r\nexport class NucleusNotificationsConfig {\r\n serverApiUrl: string;\r\n}\r\n\r\nexport class NotificationClick {\r\n id: string;\r\n type: NotificationType;\r\n routerLink?: string;\r\n}\r\n\r\nexport type NotificationEventType = 'new' | 'updated' | 'deleted' | 'deletedAll' | 'updatedAll' | 'newSilent';\r\n\r\nexport type PlatformValue = 'ios' | 'android' | 'web' | 'none';\r\n\r\nexport type NotificationType = 'default' | 'deeplink';\r\n\r\nexport interface ChannelId {\r\n senderId: string;\r\n channelId: string;\r\n}\r\n\r\nexport class UserChannelConfig {\r\n channelId: string;\r\n displayName: string;\r\n isSubscribed: boolean;\r\n subscriptionType: ChannelSubscriptionType;\r\n methods: NotifyMethod[];\r\n allowedMethods: NotifyMethod[];\r\n}\r\n\r\nexport type ChannelSubscriptionType = 'invariant' | 'optIn' | 'optOut';\r\n\r\nexport type NotifyMethod = 'push' | 'email' | 'sms';\r\n","import { HttpClient } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { SwPush } from '@angular/service-worker';\r\nimport { PushNotifications, PushNotificationSchema } from '@capacitor/push-notifications';\r\nimport { NucleusAppService } from '@kolektor/nucleus-common';\r\nimport { Observable, of, Subject } from 'rxjs';\r\nimport {\r\n ChannelId,\r\n Notification,\r\n NotificationClick,\r\n NotificationEventType,\r\n NotificationType,\r\n NucleusNotificationsConfig,\r\n PayloadData,\r\n PlatformValue,\r\n Registration,\r\n RegistrationResult,\r\n UserChannelConfig,\r\n WebKey\r\n} from './models';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class NucleusNotificationsService {\r\n\r\n constructor(\r\n private http: HttpClient,\r\n private swPush: SwPush,\r\n private appService: NucleusAppService,\r\n config: NucleusNotificationsConfig\r\n ) {\r\n let url = config.serverApiUrl;\r\n if (!url.endsWith('/')) {\r\n url += '/';\r\n }\r\n this.apiUrl = url;\r\n }\r\n\r\n private apiUrl = null;\r\n private readonly registrationStorageKey = 'NucleusNotificationsRegistrationId';\r\n private readonly notificationsStorageKey = 'NucleusNotificationsLocalCache';\r\n private _platform: PlatformValue;\r\n private _isInitialized = false;\r\n private _newNotifications = new Subject<Notification>();\r\n private _clicksSubject = new Subject<NotificationClick>();\r\n private _stateChangesSubject = new Subject<void>();\r\n\r\n public notifications: Notification[] = [];\r\n\r\n public get unreadCount() {\r\n return this.notifications.filter(x => !x.isRead).length;\r\n }\r\n\r\n public get newNotifications() {\r\n return this._newNotifications.asObservable();\r\n }\r\n\r\n public get clicks() {\r\n return this._clicksSubject.asObservable();\r\n }\r\n public get stateChanges() {\r\n return this._stateChangesSubject.asObservable();\r\n }\r\n\r\n public get isInitialized() {\r\n return this._isInitialized;\r\n }\r\n\r\n public async initialize() {\r\n // make sure app service has finished initializing\r\n await this.appService.init();\r\n\r\n this.loadFromStorage();\r\n\r\n if (this.appService.isNative) {\r\n this._platform = this.appService.deviceInfo.platform as PlatformValue;\r\n await this.registerCapacitorEvents();\r\n } else if (this.swPush.isEnabled) {\r\n this._platform = 'web';\r\n this.registerWebPushEvents();\r\n } else {\r\n console.warn('Nucleus.Notifications: There is no push capability, timer will be used to update notifications');\r\n setInterval(() => {\r\n console.log('Updating notifications...');\r\n this.refresh(true);\r\n }, 5 * 60 * 1000);\r\n }\r\n this._isInitialized = true;\r\n this.refresh();\r\n }\r\n\r\n public register(): Promise<any> {\r\n return new Promise((_resolve, _reject) => {\r\n this.getRegistrationInfo().then((info) => {\r\n this.http.post<RegistrationResult>(this.apiUrl + 'registration', info).subscribe((regResult) => {\r\n window.localStorage.setItem(this.registrationStorageKey, regResult.id);\r\n _resolve(null);\r\n }, error => {\r\n console.log('Nucleus.Notifications: Failed to send notification registration to server.', error);\r\n _reject(error);\r\n });\r\n }).catch((error) => _reject(error));\r\n });\r\n }\r\n\r\n public unregister(): Promise<any> {\r\n return new Promise((_resolve, _reject) => {\r\n this.getRegistrationInfo().then((info) => {\r\n this.http.request<any>('DELETE', this.apiUrl + 'registration', { body: info }).subscribe(() => {\r\n window.localStorage.removeItem(this.registrationStorageKey);\r\n _resolve(null);\r\n }, error => {\r\n console.log('Nucleus.Notifications: Failed to remove registration from server.', error);\r\n _reject(error);\r\n });\r\n }).catch((error) => _reject(error));\r\n });\r\n }\r\n\r\n public refresh(notifyAboutNew = false) {\r\n this.http.get<Notification[]>(this.apiUrl + 'notifications').subscribe(res => {\r\n this.updateNotifications(res, notifyAboutNew);\r\n });\r\n }\r\n\r\n public getNotification(id: string): Observable<Notification> {\r\n const localNotification = this.notifications.find(x => x.id === id);\r\n if (localNotification) {\r\n return of(localNotification);\r\n }\r\n return this.http.get<Notification>(this.apiUrl + 'notifications/' + id);\r\n }\r\n\r\n public readNotification(id: string) {\r\n const n = this.notifications.find(x => x.id === id);\r\n if (n && !n.isRead) {\r\n n.isRead = true;\r\n this.notifyStateChanged();\r\n }\r\n this.http.get(this.apiUrl + 'notifications/read/' + id).subscribe();\r\n }\r\n\r\n public dismissNotification(id: string) {\r\n this.deleteNotificaton(id);\r\n this.http.delete(this.apiUrl + 'notifications/' + id).subscribe();\r\n this.removeDeliveredNotification(id);\r\n }\r\n\r\n public dismissAll() {\r\n this.notifications.splice(0);\r\n this.notifyStateChanged();\r\n this.http.delete(this.apiUrl + 'notifications/all').subscribe();\r\n if (this._platform === 'ios' || this._platform === 'android') {\r\n PushNotifications.removeAllDeliveredNotifications();\r\n } else if (this._platform === 'web') {\r\n // TODO: remove all web push notifications\r\n }\r\n }\r\n\r\n public readAll() {\r\n for (const n of this.notifications) {\r\n n.isRead = true;\r\n }\r\n this.notifyStateChanged();\r\n this.http.get(this.apiUrl + 'notifications/read/all').subscribe();\r\n }\r\n\r\n public getChannelConfig(senderId: string, channelId: string, language: string = null) {\r\n return this.http.get<UserChannelConfig>(this.apiUrl + `settings/channel/${senderId}/${channelId}?language=${language}`);\r\n }\r\n\r\n public getChannelConfigsForSender(senderId: string, channelIds: string[], language: string = null) {\r\n const idsStr = channelIds.map(x => senderId + ',' + x).join(';');\r\n return this.getChannelConfigsInternal(idsStr, language);\r\n }\r\n\r\n public getChannelConfigs(ids: ChannelId[], language: string = null) {\r\n const idsStr = ids.map(x => x.senderId + ',' + x.channelId).join(';');\r\n return this.getChannelConfigsInternal(idsStr, language);\r\n }\r\n\r\n public setChannelConfig(senderId: string, config: UserChannelConfig) {\r\n return this.http.post<void>(`${this.apiUrl}settings/channel/${senderId}`, config);\r\n }\r\n\r\n public setChannelConfigs(configs: UserChannelConfig[]) {\r\n return this.http.post<void>(`${this.apiUrl}settings/channels`, configs);\r\n }\r\n\r\n private getChannelConfigsInternal(ids: string, language: string) {\r\n return this.http.get<UserChannelConfig[]>(`${this.apiUrl}settings/channels?ids=${ids}&language=${language}`);\r\n }\r\n\r\n private updateNotifications(newNotifications: Notification[], notifyAboutNew = false) {\r\n let stateChanged = false;\r\n for (const n of newNotifications) {\r\n const existing = this.notifications.find(x => x.id === n.id);\r\n if (existing) {\r\n if (existing.isRead !== n.isRead) {\r\n existing.isRead = n.isRead;\r\n stateChanged = true;\r\n }\r\n } else {\r\n let i = 0;\r\n while (i < this.notifications.length && n.dateCreated < this.notifications[i].dateCreated) {\r\n i++;\r\n }\r\n this.notifications.splice(i, 0, n);\r\n stateChanged = true;\r\n if (notifyAboutNew) {\r\n this._newNotifications.next(n);\r\n }\r\n }\r\n }\r\n\r\n const now = Date.now();\r\n for (let i = this.notifications.length - 1; i >= 0; i--) {\r\n const n = this.notifications[i];\r\n if (new Date(n.expirationDate).getTime() < now || !newNotifications.find(x => x.id === n.id)) {\r\n this.notifications.splice(i, 1);\r\n stateChanged = true;\r\n }\r\n }\r\n\r\n if (stateChanged) {\r\n this.notifyStateChanged();\r\n }\r\n }\r\n\r\n private saveToStorage() {\r\n const str = JSON.stringify(this.notifications);\r\n window.localStorage.setItem(this.notificationsStorageKey, str);\r\n }\r\n\r\n private loadFromStorage() {\r\n try {\r\n const str = window.localStorage.getItem(this.notificationsStorageKey);\r\n if (str) {\r\n const notifications = JSON.parse(str) as Notification[];\r\n this.notifications = notifications.filter(x => !!x);\r\n // precaution for notification.isRead of undefined error\r\n this.notifyStateChanged(false);\r\n }\r\n } catch { }\r\n }\r\n\r\n private handleNotificationEvent(id: string, eventType: NotificationEventType) {\r\n if (eventType.startsWith('new') || eventType === 'updated') { // we are handling new and newSilent\r\n this.getNotification(id).subscribe(n => {\r\n if (eventType.startsWith('new') && !n.isRead) {\r\n this._newNotifications.next(n);\r\n }\r\n const existing = this.notifications.find(x => x.id === n.id);\r\n if (existing) {\r\n existing.isRead = n.isRead;\r\n } else {\r\n this.notifications.splice(0, 0, n);\r\n }\r\n this.notifyStateChanged();\r\n });\r\n } else if (eventType === 'deleted') {\r\n this.deleteNotificaton(id);\r\n } else {\r\n this.refresh();\r\n }\r\n }\r\n\r\n private deleteNotificaton(id: string) {\r\n const i = this.notifications.findIndex(x => x.id === id);\r\n if (i >= 0) {\r\n this.notifications.splice(i, 1);\r\n this.notifyStateChanged();\r\n }\r\n }\r\n\r\n private notifyStateChanged(persistState = true) {\r\n if (persistState) {\r\n this.saveToStorage();\r\n }\r\n this._stateChangesSubject.next();\r\n }\r\n\r\n private handleNotificationAction(notificationAction: string) {\r\n const arr = notificationAction.split(':');\r\n const notificationClick: NotificationClick = {\r\n id: arr[0],\r\n type: arr[1] as NotificationType,\r\n routerLink: arr[2]\r\n };\r\n\r\n const validNotificationClickTypes = ['default', 'deeplink'];\r\n if (validNotificationClickTypes.includes(notificationClick.type)) {\r\n this._clicksSubject.next(notificationClick);\r\n } else {\r\n console.error(`Nucleus.Notifications: Unknown notification action: '${notificationAction}'.`);\r\n }\r\n }\r\n\r\n private removeDeliveredNotification(id: string) {\r\n if (this._platform === 'ios' || this._platform === 'android') {\r\n PushNotifications.getDeliveredNotifications().then(list => {\r\n const toRemove = list.notifications.filter(n => {\r\n const data = this.getNotificationPayloadData(n);\r\n return (data.notificationId === id);\r\n });\r\n\r\n // TODO: On Android this does not currently work because notificationID is not set.\r\n // This my solve the issue: https://github.com/ionic-team/capacitor/pull/3523\r\n PushNotifications.removeDeliveredNotifications({\r\n notifications: toRemove\r\n });\r\n });\r\n } else if (this._platform === 'web') {\r\n // TODO: remove web push notification\r\n }\r\n }\r\n\r\n private getNotificationPayloadData(pushNotification: PushNotificationSchema): PayloadData {\r\n return (this._platform === 'ios') ? pushNotification.data.data : pushNotification.data;\r\n }\r\n\r\n private async registerCapacitorEvents() {\r\n await PushNotifications.addListener('pushNotificationReceived', n => {\r\n const data = this.getNotificationPayloadData(n);\r\n console.log('Nucleus.Notifications: Received capacitor push event: ' + data.eventType, n);\r\n this.handleNotificationEvent(data.notificationId, data.eventType);\r\n });\r\n\r\n await PushNotifications.addListener('pushNotificationActionPerformed', a => {\r\n let action = (a as any).notification.data.notificationAction;\r\n if (this._platform === 'ios') {\r\n action = (a as any).notification.data.data.notificationAction;\r\n }\r\n console.log('Nucleus.Notifications: Received capacitor action event', action);\r\n this.handleNotificationAction(action);\r\n });\r\n }\r\n\r\n private registerWebPushEvents() {\r\n this.swPush.messages.subscribe((n) => {\r\n const data: PayloadData = (n as any).data;\r\n console.log('Nucleus.Notifications: Received WebPush event: ' + data.eventType, n);\r\n this.handleNotificationEvent(data.notificationId, data.eventType);\r\n });\r\n\r\n this.swPush.notificationClicks.subscribe((action) => {\r\n console.log('Nucleus.Notifications: Received WebPush action event', action);\r\n const tag = action.notification.tag;\r\n this.handleNotificationAction(tag);\r\n });\r\n }\r\n\r\n private getRegistrationInfo(): Promise<Registration> {\r\n return new Promise((_resolve, _reject) => {\r\n const registrationId = window.localStorage.getItem(this.registrationStorageKey);\r\n if (this._platform === 'android' || this._platform === 'ios') {\r\n // capacitor platform\r\n const listener = PushNotifications.addListener('registration', token => {\r\n listener.remove();\r\n _resolve({ id: registrationId, token: token.value, platform: this._platform });\r\n });\r\n PushNotifications.register().catch(error => _reject('Could not register for notifications:' + error));\r\n } else if (this._platform === 'web') {\r\n // Web Push API\r\n this.http.get<WebKey>(this.apiUrl + 'registration/webkey').subscribe(key => {\r\n this.getWebPushSubscription(key.publicKey).then(subscription => {\r\n const t = JSON.stringify(subscription.toJSON());\r\n _resolve({ id: registrationId, token: t, platform: 'web' });\r\n });\r\n }, error => _reject(error));\r\n } else {\r\n _reject(`Nucleus.Notifications: Platform is not supported`);\r\n }\r\n });\r\n }\r\n\r\n private getWebPushSubscription(publicKey: string): Promise<PushSubscription> {\r\n return new Promise((_resolve, _reject) => {\r\n this.swPush.subscription.subscribe(subscription => {\r\n if (subscription != null) {\r\n _resolve(subscription);\r\n } else {\r\n this.swPush.requestSubscription({ serverPublicKey: publicKey }).then(s => _resolve(s)).catch(e => _reject(e));\r\n }\r\n }, error => {\r\n console.error('Nucleus.Notifications: Cannot get web push subscription', error);\r\n _reject(error);\r\n });\r\n });\r\n }\r\n}\r\n","import { NgModule, ModuleWithProviders } from '@angular/core';\r\nimport { NucleusNotificationsConfig } from './models';\r\n\r\n@NgModule({\r\n declarations: [],\r\n imports: [\r\n ],\r\n exports: []\r\n})\r\nexport class NucleusNotificationsModule {\r\n\r\n static forRoot(config: NucleusNotificationsConfig): ModuleWithProviders<NucleusNotificationsModule> {\r\n return {\r\n ngModule: NucleusNotificationsModule,\r\n providers: [\r\n { provide: NucleusNotificationsConfig, useValue: config }\r\n ]\r\n };\r\n }\r\n}\r\n","/*\r\n * Public API Surface of nucleus-notifications\r\n */\r\n\r\nexport * from './lib/nucleus-notifications.service';\r\nexport * from './lib/nucleus-notifications.module';\r\nexport * from './lib/models';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i4.NucleusNotificationsConfig"],"mappings":";;;;;;;;;MAAa,YAAY,CAAA;AAOxB,CAAA;MAEY,QAAQ,CAAA;AAIpB,CAAA;MAEY,SAAS,CAAA;AAIrB,CAAA;MAEY,gBAAgB,CAAA;AAM5B,CAAA;MAEY,MAAM,CAAA;AAElB,CAAA;MAEY,YAAY,CAAA;AAIxB,CAAA;MAEY,kBAAkB,CAAA;AAE9B,CAAA;MAEY,WAAW,CAAA;AAGvB,CAAA;MAEY,0BAA0B,CAAA;AAEtC,CAAA;MAEY,iBAAiB,CAAA;AAI7B,CAAA;MAaY,iBAAiB,CAAA;AAO7B;;MCpDY,2BAA2B,CAAA;AAEtC,IAAA,WAAA,CACU,IAAgB,EAChB,MAAc,EACd,UAA6B,EACrC,MAAkC,EAAA;AAH1B,QAAA,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAY;AAChB,QAAA,IAAM,CAAA,MAAA,GAAN,MAAM,CAAQ;AACd,QAAA,IAAU,CAAA,UAAA,GAAV,UAAU,CAAmB;AAU/B,QAAA,IAAM,CAAA,MAAA,GAAG,IAAI,CAAC;AACL,QAAA,IAAsB,CAAA,sBAAA,GAAG,oCAAoC,CAAC;AAC9D,QAAA,IAAuB,CAAA,uBAAA,GAAG,gCAAgC,CAAC;AAEpE,QAAA,IAAc,CAAA,cAAA,GAAG,KAAK,CAAC;AACvB,QAAA,IAAA,CAAA,iBAAiB,GAAG,IAAI,OAAO,EAAgB,CAAC;AAChD,QAAA,IAAA,CAAA,cA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AkC,EAAA;QAC/C,OAAO;AACL,YAAA,QAAQ,EAAE,0BAA0B;AACpC,YAAA,SAAS,EAAE;AACT,gBAAA,EAAE,OAAO,EAAE,0BAA0B,EAAE,QAAQ,EAAE,MAAM,EAAE;AAC1D,aAAA;SACF,CAAC;KACH;;uHATU,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;wHAA1B,0BAA0B,EAAA,CAAA,CAAA;wHAA1B,0BAA0B,EAAA,CAAA,CAAA;2FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBANtC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE,EACR;AACD,oBAAA,OAAO,EAAE,EAAE;iBACZ,CAAA;;;ACRD;;AAEG;;ACFH;;AAEG;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"kolektor-nucleus-notifications.mjs","sources":["../../../projects/nucleus-notifications/src/lib/models.ts","../../../projects/nucleus-notifications/src/lib/nucleus-notifications.service.ts","../../../projects/nucleus-notifications/src/lib/nucleus-notifications.module.ts","../../../projects/nucleus-notifications/src/public-api.ts","../../../projects/nucleus-notifications/src/kolektor-nucleus-notifications.ts"],"sourcesContent":["export class Notification {\r\n public id: string;\r\n public sender: Identity;\r\n public data: NotificationData;\r\n public isRead: boolean;\r\n public dateCreated: Date;\r\n public expirationDate: Date;\r\n}\r\n\r\nexport class Identity {\r\n public subject: string;\r\n public name: string;\r\n public pictureUrl: string;\r\n}\r\n\r\nexport class Recipient {\r\n public attributeName: string;\r\n public directoryName: string;\r\n public attributeValue: string;\r\n}\r\n\r\nexport class NotificationData {\r\n title: string;\r\n message: string;\r\n htmlMessage: string;\r\n preventDismissal: boolean;\r\n deepLink: string;\r\n}\r\n\r\nexport class WebKey {\r\n publicKey: string;\r\n}\r\n\r\nexport class Registration {\r\n id: string;\r\n token: string;\r\n platform: PlatformValue;\r\n}\r\n\r\nexport class RegistrationResult {\r\n id: string;\r\n}\r\n\r\nexport class PayloadData {\r\n notificationId: string;\r\n eventType: NotificationEventType;\r\n}\r\n\r\nexport class NucleusNotificationsConfig {\r\n serverApiUrl: string;\r\n}\r\n\r\nexport class NotificationClick {\r\n id: string;\r\n type: NotificationType;\r\n routerLink?: string;\r\n}\r\n\r\nexport type NotificationEventType = 'new' | 'updated' | 'deleted' | 'deletedAll' | 'updatedAll' | 'newSilent';\r\n\r\nexport type PlatformValue = 'ios' | 'android' | 'web' | 'none';\r\n\r\nexport type NotificationType = 'default' | 'deeplink';\r\n\r\nexport interface ChannelId {\r\n senderId: string;\r\n channelId: string;\r\n}\r\n\r\nexport class UserChannelConfig {\r\n channelId: string;\r\n displayName: string;\r\n isSubscribed: boolean;\r\n subscriptionType: ChannelSubscriptionType;\r\n methods: NotifyMethod[];\r\n allowedMethods: NotifyMethod[];\r\n}\r\n\r\nexport type ChannelSubscriptionType = 'invariant' | 'optIn' | 'optOut';\r\n\r\nexport type NotifyMethod = 'push' | 'email' | 'sms';\r\n","import { HttpClient } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { SwPush } from '@angular/service-worker';\r\nimport { PushNotifications, PushNotificationSchema } from '@capacitor/push-notifications';\r\nimport { NucleusAppService } from '@kolektor/nucleus-common';\r\nimport { Observable, of, Subject } from 'rxjs';\r\nimport {\r\n ChannelId,\r\n Notification,\r\n NotificationClick,\r\n NotificationEventType,\r\n NotificationType,\r\n NucleusNotificationsConfig,\r\n PayloadData,\r\n PlatformValue,\r\n Registration,\r\n RegistrationResult,\r\n UserChannelConfig,\r\n WebKey\r\n} from './models';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class NucleusNotificationsService {\r\n\r\n constructor(\r\n private http: HttpClient,\r\n private swPush: SwPush,\r\n private appService: NucleusAppService,\r\n config: NucleusNotificationsConfig\r\n ) {\r\n let url = config.serverApiUrl;\r\n if (!url.endsWith('/')) {\r\n url += '/';\r\n }\r\n this.apiUrl = url;\r\n }\r\n\r\n private apiUrl = null;\r\n private readonly registrationStorageKey = 'NucleusNotificationsRegistrationId';\r\n private readonly notificationsStorageKey = 'NucleusNotificationsLocalCache';\r\n private _platform: PlatformValue;\r\n private _isInitialized = false;\r\n private _newNotifications = new Subject<Notification>();\r\n private _clicksSubject = new Subject<NotificationClick>();\r\n private _stateChangesSubject = new Subject<void>();\r\n\r\n public notifications: Notification[] = [];\r\n\r\n public get unreadCount() {\r\n return this.notifications.filter(x => !x.isRead).length;\r\n }\r\n\r\n public get newNotifications() {\r\n return this._newNotifications.asObservable();\r\n }\r\n\r\n public get clicks() {\r\n return this._clicksSubject.asObservable();\r\n }\r\n public get stateChanges() {\r\n return this._stateChangesSubject.asObservable();\r\n }\r\n\r\n public get isInitialized() {\r\n return this._isInitialized;\r\n }\r\n\r\n public async initialize() {\r\n // make sure app service has finished initializing\r\n await this.appService.init();\r\n\r\n this.loadFromStorage();\r\n\r\n if (this.appService.isNative) {\r\n this._platform = this.appService.deviceInfo.platform as PlatformValue;\r\n await this.registerCapacitorEvents();\r\n } else if (this.swPush.isEnabled) {\r\n this._platform = 'web';\r\n this.registerWebPushEvents();\r\n } else {\r\n console.warn('Nucleus.Notifications: There is no push capability, timer will be used to update notifications');\r\n setInterval(() => {\r\n console.log('Updating notifications...');\r\n this.refresh(true);\r\n }, 5 * 60 * 1000);\r\n }\r\n this._isInitialized = true;\r\n this.refresh();\r\n }\r\n\r\n public register(): Promise<any> {\r\n return new Promise((_resolve, _reject) => {\r\n this.getRegistrationInfo().then((info) => {\r\n this.http.post<RegistrationResult>(this.apiUrl + 'registration', info).subscribe((regResult) => {\r\n window.localStorage.setItem(this.registrationStorageKey, regResult.id);\r\n _resolve(null);\r\n }, error => {\r\n console.log('Nucleus.Notifications: Failed to send notification registration to server.', error);\r\n _reject(error);\r\n });\r\n }).catch((error) => _reject(error));\r\n });\r\n }\r\n\r\n public unregister(): Promise<any> {\r\n return new Promise((_resolve, _reject) => {\r\n this.getRegistrationInfo().then((info) => {\r\n this.http.request<any>('DELETE', this.apiUrl + 'registration', { body: info }).subscribe(() => {\r\n window.localStorage.removeItem(this.registrationStorageKey);\r\n _resolve(null);\r\n }, error => {\r\n console.log('Nucleus.Notifications: Failed to remove registration from server.', error);\r\n _reject(error);\r\n });\r\n }).catch((error) => _reject(error));\r\n });\r\n }\r\n\r\n public refresh(notifyAboutNew = false) {\r\n this.http.get<Notification[]>(this.apiUrl + 'notifications').subscribe(res => {\r\n this.updateNotifications(res, notifyAboutNew);\r\n });\r\n }\r\n\r\n public getNotification(id: string): Observable<Notification> {\r\n const localNotification = this.notifications.find(x => x.id === id);\r\n if (localNotification) {\r\n return of(localNotification);\r\n }\r\n return this.http.get<Notification>(this.apiUrl + 'notifications/' + id);\r\n }\r\n\r\n public readNotification(id: string) {\r\n const n = this.notifications.find(x => x.id === id);\r\n if (n && !n.isRead) {\r\n n.isRead = true;\r\n this.notifyStateChanged();\r\n }\r\n this.http.get(this.apiUrl + 'notifications/read/' + id).subscribe();\r\n }\r\n\r\n public dismissNotification(id: string) {\r\n this.deleteNotificaton(id);\r\n this.http.delete(this.apiUrl + 'notifications/' + id).subscribe();\r\n this.removeDeliveredNotification(id);\r\n }\r\n\r\n public dismissAll() {\r\n this.notifications.splice(0);\r\n this.notifyStateChanged();\r\n this.http.delete(this.apiUrl + 'notifications/all').subscribe();\r\n if (this._platform === 'ios' || this._platform === 'android') {\r\n PushNotifications.removeAllDeliveredNotifications();\r\n } else if (this._platform === 'web') {\r\n // TODO: remove all web push notifications\r\n }\r\n }\r\n\r\n public readAll() {\r\n for (const n of this.notifications) {\r\n n.isRead = true;\r\n }\r\n this.notifyStateChanged();\r\n this.http.get(this.apiUrl + 'notifications/read/all').subscribe();\r\n }\r\n\r\n public getChannelConfig(senderId: string, channelId: string, language: string = null) {\r\n return this.http.get<UserChannelConfig>(this.apiUrl + `settings/channel/${senderId}/${channelId}?language=${language}`);\r\n }\r\n\r\n public getChannelConfigsForSender(senderId: string, channelIds: string[], language: string = null) {\r\n const idsStr = channelIds.map(x => senderId + ',' + x).join(';');\r\n return this.getChannelConfigsInternal(idsStr, language);\r\n }\r\n\r\n public getChannelConfigs(ids: ChannelId[], language: string = null) {\r\n const idsStr = ids.map(x => x.senderId + ',' + x.channelId).join(';');\r\n return this.getChannelConfigsInternal(idsStr, language);\r\n }\r\n\r\n public setChannelConfig(senderId: string, config: UserChannelConfig) {\r\n return this.http.post<void>(`${this.apiUrl}settings/channel/${senderId}`, config);\r\n }\r\n\r\n public setChannelConfigs(configs: UserChannelConfig[]) {\r\n return this.http.post<void>(`${this.apiUrl}settings/channels`, configs);\r\n }\r\n\r\n private getChannelConfigsInternal(ids: string, language: string) {\r\n return this.http.get<UserChannelConfig[]>(`${this.apiUrl}settings/channels?ids=${ids}&language=${language}`);\r\n }\r\n\r\n private updateNotifications(newNotifications: Notification[], notifyAboutNew = false) {\r\n let stateChanged = false;\r\n for (const n of newNotifications) {\r\n const existing = this.notifications.find(x => x.id === n.id);\r\n if (existing) {\r\n if (existing.isRead !== n.isRead) {\r\n existing.isRead = n.isRead;\r\n stateChanged = true;\r\n }\r\n } else {\r\n let i = 0;\r\n while (i < this.notifications.length && n.dateCreated < this.notifications[i].dateCreated) {\r\n i++;\r\n }\r\n this.notifications.splice(i, 0, n);\r\n stateChanged = true;\r\n if (notifyAboutNew) {\r\n this._newNotifications.next(n);\r\n }\r\n }\r\n }\r\n\r\n const now = Date.now();\r\n for (let i = this.notifications.length - 1; i >= 0; i--) {\r\n const n = this.notifications[i];\r\n if (new Date(n.expirationDate).getTime() < now || !newNotifications.find(x => x.id === n.id)) {\r\n this.notifications.splice(i, 1);\r\n stateChanged = true;\r\n }\r\n }\r\n\r\n if (stateChanged) {\r\n this.notifyStateChanged();\r\n }\r\n }\r\n\r\n private saveToStorage() {\r\n const str = JSON.stringify(this.notifications);\r\n window.localStorage.setItem(this.notificationsStorageKey, str);\r\n }\r\n\r\n private loadFromStorage() {\r\n try {\r\n const str = window.localStorage.getItem(this.notificationsStorageKey);\r\n if (str) {\r\n const notifications = JSON.parse(str) as Notification[];\r\n this.notifications = notifications.filter(x => !!x);\r\n // precaution for notification.isRead of undefined error\r\n this.notifyStateChanged(false);\r\n }\r\n } catch { }\r\n }\r\n\r\n private handleNotificationEvent(id: string, eventType: NotificationEventType) {\r\n if (eventType.startsWith('new') || eventType === 'updated') { // we are handling new and newSilent\r\n this.getNotification(id).subscribe(n => {\r\n if (eventType.startsWith('new') && !n.isRead) {\r\n this._newNotifications.next(n);\r\n }\r\n const existing = this.notifications.find(x => x.id === n.id);\r\n if (existing) {\r\n existing.isRead = n.isRead;\r\n } else {\r\n this.notifications.splice(0, 0, n);\r\n }\r\n this.notifyStateChanged();\r\n });\r\n } else if (eventType === 'deleted') {\r\n this.deleteNotificaton(id);\r\n } else {\r\n this.refresh();\r\n }\r\n }\r\n\r\n private deleteNotificaton(id: string) {\r\n const i = this.notifications.findIndex(x => x.id === id);\r\n if (i >= 0) {\r\n this.notifications.splice(i, 1);\r\n this.notifyStateChanged();\r\n }\r\n }\r\n\r\n private notifyStateChanged(persistState = true) {\r\n if (persistState) {\r\n this.saveToStorage();\r\n }\r\n this._stateChangesSubject.next();\r\n }\r\n\r\n private handleNotificationAction(notificationAction: string) {\r\n const arr = notificationAction.split(':');\r\n const notificationClick: NotificationClick = {\r\n id: arr[0],\r\n type: arr[1] as NotificationType,\r\n routerLink: arr[2]\r\n };\r\n\r\n const validNotificationClickTypes = ['default', 'deeplink'];\r\n if (validNotificationClickTypes.includes(notificationClick.type)) {\r\n this._clicksSubject.next(notificationClick);\r\n } else {\r\n console.error(`Nucleus.Notifications: Unknown notification action: '${notificationAction}'.`);\r\n }\r\n }\r\n\r\n private removeDeliveredNotification(id: string) {\r\n if (this._platform === 'ios' || this._platform === 'android') {\r\n PushNotifications.getDeliveredNotifications().then(list => {\r\n const toRemove = list.notifications.filter(n => {\r\n const data = this.getNotificationPayloadData(n);\r\n return (data.notificationId === id);\r\n });\r\n\r\n // TODO: On Android this does not currently work because notificationID is not set.\r\n // This my solve the issue: https://github.com/ionic-team/capacitor/pull/3523\r\n PushNotifications.removeDeliveredNotifications({\r\n notifications: toRemove\r\n });\r\n });\r\n } else if (this._platform === 'web') {\r\n // TODO: remove web push notification\r\n }\r\n }\r\n\r\n private getNotificationPayloadData(pushNotification: PushNotificationSchema): PayloadData {\r\n return (this._platform === 'ios') ? pushNotification.data.data : pushNotification.data;\r\n }\r\n\r\n private async registerCapacitorEvents() {\r\n await PushNotifications.addListener('pushNotificationReceived', n => {\r\n const data = this.getNotificationPayloadData(n);\r\n console.log('Nucleus.Notifications: Received capacitor push event: ' + data.eventType, n);\r\n this.handleNotificationEvent(data.notificationId, data.eventType);\r\n });\r\n\r\n await PushNotifications.addListener('pushNotificationActionPerformed', a => {\r\n let action = (a as any).notification.data.notificationAction;\r\n if (this._platform === 'ios') {\r\n action = (a as any).notification.data.data.notificationAction;\r\n }\r\n console.log('Nucleus.Notifications: Received capacitor action event', action);\r\n this.handleNotificationAction(action);\r\n });\r\n }\r\n\r\n private registerWebPushEvents() {\r\n this.swPush.messages.subscribe((n) => {\r\n const data: PayloadData = (n as any).data;\r\n console.log('Nucleus.Notifications: Received WebPush event: ' + data.eventType, n);\r\n this.handleNotificationEvent(data.notificationId, data.eventType);\r\n });\r\n\r\n this.swPush.notificationClicks.subscribe((action) => {\r\n console.log('Nucleus.Notifications: Received WebPush action event', action);\r\n const tag = action.notification.tag;\r\n this.handleNotificationAction(tag);\r\n });\r\n }\r\n\r\n private getRegistrationInfo(): Promise<Registration> {\r\n return new Promise((_resolve, _reject) => {\r\n const registrationId = window.localStorage.getItem(this.registrationStorageKey);\r\n if (this._platform === 'android' || this._platform === 'ios') {\r\n // capacitor platform\r\n const listener = PushNotifications.addListener('registration', token => {\r\n listener.remove();\r\n _resolve({ id: registrationId, token: token.value, platform: this._platform });\r\n });\r\n PushNotifications.register().catch(error => _reject('Could not register for notifications:' + error));\r\n } else if (this._platform === 'web') {\r\n // Web Push API\r\n this.http.get<WebKey>(this.apiUrl + 'registration/webkey').subscribe(key => {\r\n this.getWebPushSubscription(key.publicKey).then(subscription => {\r\n const t = JSON.stringify(subscription.toJSON());\r\n _resolve({ id: registrationId, token: t, platform: 'web' });\r\n });\r\n }, error => _reject(error));\r\n } else {\r\n _reject(`Nucleus.Notifications: Platform is not supported`);\r\n }\r\n });\r\n }\r\n\r\n private getWebPushSubscription(publicKey: string): Promise<PushSubscription> {\r\n return new Promise((_resolve, _reject) => {\r\n this.swPush.subscription.subscribe(subscription => {\r\n if (subscription != null) {\r\n _resolve(subscription);\r\n } else {\r\n this.swPush.requestSubscription({ serverPublicKey: publicKey }).then(s => _resolve(s)).catch(e => _reject(e));\r\n }\r\n }, error => {\r\n console.error('Nucleus.Notifications: Cannot get web push subscription', error);\r\n _reject(error);\r\n });\r\n });\r\n }\r\n}\r\n","import { NgModule, ModuleWithProviders } from '@angular/core';\r\nimport { NucleusNotificationsConfig } from './models';\r\n\r\n@NgModule({\r\n declarations: [],\r\n imports: [\r\n ],\r\n exports: []\r\n})\r\nexport class NucleusNotificationsModule {\r\n\r\n static forRoot(config: NucleusNotificationsConfig): ModuleWithProviders<NucleusNotificationsModule> {\r\n return {\r\n ngModule: NucleusNotificationsModule,\r\n providers: [\r\n { provide: NucleusNotificationsConfig, useValue: config }\r\n ]\r\n };\r\n }\r\n}\r\n","/*\r\n * Public API Surface of nucleus-notifications\r\n */\r\n\r\nexport * from './lib/nucleus-notifications.service';\r\nexport * from './lib/nucleus-notifications.module';\r\nexport * from './lib/models';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i4.NucleusNotificationsConfig"],"mappings":";;;;;;;;MAAa,YAAY,CAAA;AAOxB,CAAA;MAEY,QAAQ,CAAA;AAIpB,CAAA;MAEY,SAAS,CAAA;AAIrB,CAAA;MAEY,gBAAgB,CAAA;AAM5B,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;ACFH;;AAEG;;;;"}
package/public-api.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from './lib/nucleus-notifications.service';
2
- export * from './lib/nucleus-notifications.module';
3
- export * from './lib/models';