From f61723599e753d40cf7afbbaaf13bea677bd9477 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eudes=20In=C3=A1cio?= Date: Sat, 30 Oct 2021 16:51:29 +0100 Subject: [PATCH 1/9] Remove IBM push notification and jsonstore, added cordova notifications --- config.xml | 4 +- package-lock.json | 443 ++------------------ package.json | 17 +- src/app/app.component.ts | 16 +- src/app/app.module.ts | 4 +- src/app/home/home.page.ts | 11 +- src/app/modals/profile/profile.page.ts | 2 +- src/app/pages/agenda/agenda.page.ts | 1 + src/app/pages/events/events.page.ts | 51 ++- src/app/pages/inactivity/inactivity.page.ts | 2 +- src/app/services/jsonStore.service.ts | 10 +- src/app/services/notifications.service.ts | 76 +++- src/app/services/sqlite.service.ts | 1 + 13 files changed, 165 insertions(+), 473 deletions(-) diff --git a/config.xml b/config.xml index d778d7312..bd410ebfa 100644 --- a/config.xml +++ b/config.xml @@ -47,7 +47,7 @@ - 1109370933 + 3077110622 3619450036 @@ -81,7 +81,7 @@ 0 - 8.0.0.00-20210308-063916 + 8.0.0.00-20210905-154328 diff --git a/package-lock.json b/package-lock.json index a8bc50374..ae4d69471 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2192,6 +2192,21 @@ "@types/cordova": "^0.0.34" } }, + "@ionic-native/fcm": { + "version": "5.36.0", + "resolved": "https://registry.npmjs.org/@ionic-native/fcm/-/fcm-5.36.0.tgz", + "integrity": "sha512-hToPT/4lqdaCc99sUYgnHM+DSFTe4WphF7Ia00QtwsNGW5/pS8w9iZSgppij5OJtwe67dNsuf2+PkxS4r7av/g==", + "requires": { + "@types/cordova": "^0.0.34" + }, + "dependencies": { + "@types/cordova": { + "version": "0.0.34", + "resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz", + "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ=" + } + } + }, "@ionic-native/file": { "version": "5.36.0", "resolved": "https://registry.npmjs.org/@ionic-native/file/-/file-5.36.0.tgz", @@ -6965,6 +6980,15 @@ "integrity": "sha512-FUHI6eEVeoz2VkxbF0P56QlUQLGzXcvw3i4xuXyM9gEct6Y+FA3Xzgl2pJTZcTg5wRqLWzN08kgNoHPkom15pw==", "dev": true }, + "cordova-plugin-fcm-with-dependecy-updated": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/cordova-plugin-fcm-with-dependecy-updated/-/cordova-plugin-fcm-with-dependecy-updated-7.8.0.tgz", + "integrity": "sha512-p2pbY1oqQ2UDbaWOWA2z84uMXmdDGYmK2O+mrufj1bZyoFodt7WqrtiB9oDnUuSSinMrdNFrupiWEDMSBSNVeQ==", + "dev": true, + "requires": { + "typescript": "^4.1.3" + } + }, "cordova-plugin-file": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/cordova-plugin-file/-/cordova-plugin-file-6.0.2.tgz", @@ -8524,425 +8548,6 @@ } } }, - "cordova-plugin-mfp-jsonstore": { - "version": "8.0.2021090603", - "resolved": "https://registry.npmjs.org/cordova-plugin-mfp-jsonstore/-/cordova-plugin-mfp-jsonstore-8.0.2021090603.tgz", - "integrity": "sha512-a8IqMSTkkGXe3bq0n8OamufVhcTHRX5EgZlA6kS+uy4m40h3BeaL78LglyW8Y5BJOVI5evJyTNt8FqI8qPPgdw==", - "dev": true, - "requires": { - "ibm-strings": "~0.1.0", - "mfp-config-xml": "0.0.5", - "npmlog": "0.0.6", - "shelljs": "0.3.0", - "xcode": "0.8.7" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true - }, - "ansi": { - "version": "0.3.1", - "bundled": true, - "dev": true - }, - "are-we-there-yet": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.0 || ^1.1.13" - } - }, - "balanced-match": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "base64-js": { - "version": "0.0.6", - "bundled": true, - "dev": true - }, - "bplist-creator": { - "version": "0.0.4", - "bundled": true, - "dev": true, - "requires": { - "stream-buffers": "~0.2.3" - } - }, - "bplist-parser": { - "version": "0.0.6", - "bundled": true, - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "colors": { - "version": "1.1.2", - "bundled": true, - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "core-util-is": { - "version": "1.0.3", - "bundled": true, - "dev": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "elementtree": { - "version": "0.1.6", - "bundled": true, - "dev": true, - "requires": { - "sax": "0.3.5" - } - }, - "extsprintf": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "findup-sync": { - "version": "0.3.0", - "bundled": true, - "dev": true, - "requires": { - "glob": "~5.0.0" - }, - "dependencies": { - "glob": { - "version": "5.0.15", - "bundled": true, - "dev": true, - "requires": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } - } - }, - "gauge": { - "version": "1.2.7", - "bundled": true, - "dev": true, - "requires": { - "ansi": "^0.3.0", - "has-unicode": "^2.0.0", - "lodash.pad": "^4.1.0", - "lodash.padend": "^4.1.0", - "lodash.padstart": "^4.1.0" - } - }, - "glob": { - "version": "7.0.3", - "bundled": true, - "dev": true, - "requires": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true - }, - "ibm-strings": { - "version": "0.1.4", - "bundled": true, - "dev": true, - "requires": { - "colors": "1.1.2", - "nopt": "3.0.6" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "bundled": true, - "dev": true - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "lodash-node": { - "version": "2.4.1", - "bundled": true, - "dev": true - }, - "lodash.pad": { - "version": "4.5.1", - "bundled": true, - "dev": true - }, - "lodash.padend": { - "version": "4.6.1", - "bundled": true, - "dev": true - }, - "lodash.padstart": { - "version": "4.6.1", - "bundled": true, - "dev": true - }, - "mfp-config-xml": { - "version": "0.0.5", - "bundled": true, - "dev": true, - "requires": { - "elementtree": "0.1.6", - "findup-sync": "0.3.0", - "glob": "7.0.3", - "ibm-strings": "0.1.4", - "npmlog": "2.0.2", - "q": "1.4.1", - "underscore": "1.8.3", - "verror": "1.6.1" - }, - "dependencies": { - "npmlog": { - "version": "2.0.2", - "bundled": true, - "dev": true, - "requires": { - "ansi": "~0.3.1", - "are-we-there-yet": "~1.0.6", - "gauge": "~1.2.5" - } - } - } - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "node-uuid": { - "version": "1.4.7", - "bundled": true, - "dev": true - }, - "nopt": { - "version": "3.0.6", - "bundled": true, - "dev": true, - "requires": { - "abbrev": "1" - } - }, - "npmlog": { - "version": "0.0.6", - "bundled": true, - "dev": true, - "requires": { - "ansi": "~0.2.1" - }, - "dependencies": { - "ansi": { - "version": "0.2.1", - "bundled": true, - "dev": true - } - } - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "pegjs": { - "version": "0.6.2", - "bundled": true, - "dev": true - }, - "plist": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "base64-js": "0.0.6", - "util-deprecate": "1.0.0", - "xmlbuilder": "2.2.1", - "xmldom": "0.1.x" - }, - "dependencies": { - "util-deprecate": { - "version": "1.0.0", - "bundled": true, - "dev": true - } - } - }, - "process-nextick-args": { - "version": "2.0.1", - "bundled": true, - "dev": true - }, - "q": { - "version": "1.4.1", - "bundled": true, - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "bundled": true, - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true, - "dev": true - }, - "sax": { - "version": "0.3.5", - "bundled": true, - "dev": true - }, - "shelljs": { - "version": "0.3.0", - "bundled": true, - "dev": true - }, - "simple-plist": { - "version": "0.0.4", - "bundled": true, - "dev": true, - "requires": { - "bplist-creator": "0.0.4", - "bplist-parser": "0.0.6", - "plist": "1.1.0" - } - }, - "stream-buffers": { - "version": "0.2.6", - "bundled": true, - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "underscore": { - "version": "1.8.3", - "bundled": true, - "dev": true - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "verror": { - "version": "1.6.1", - "bundled": true, - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "extsprintf": "1.2.0" - }, - "dependencies": { - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true - } - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "xcode": { - "version": "0.8.7", - "bundled": true, - "dev": true, - "requires": { - "node-uuid": "1.4.7", - "pegjs": "0.6.2", - "simple-plist": "0.0.4" - } - }, - "xmlbuilder": { - "version": "2.2.1", - "bundled": true, - "dev": true, - "requires": { - "lodash-node": "~2.4.1" - } - }, - "xmldom": { - "version": "0.1.31", - "bundled": true, - "dev": true - } - } - }, - "cordova-plugin-mfp-push": { - "version": "8.0.2021062405", - "resolved": "https://registry.npmjs.org/cordova-plugin-mfp-push/-/cordova-plugin-mfp-push-8.0.2021062405.tgz", - "integrity": "sha512-OOSV4TCkZVNfwQzjfbsD0ycNcZyokKdBPJnEK/QrtrGtEA+Ah1R86FphXFNJtCWEQYybCCHvCVXgor4Pgf11xQ==", - "dev": true - }, "cordova-plugin-network-information": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cordova-plugin-network-information/-/cordova-plugin-network-information-3.0.0.tgz", diff --git a/package.json b/package.json index dd62807a4..980b14a9c 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "@fullcalendar/interaction": "^5.3.0", "@ionic-native/camera": "^5.31.1", "@ionic-native/core": "^5.0.7", + "@ionic-native/fcm": "^5.36.0", "@ionic-native/file": "^5.36.0", "@ionic-native/file-path": "^5.30.0", "@ionic-native/fingerprint-aio": "^4.20.0", @@ -143,6 +144,7 @@ "cordova-plugin-crosswalk-webview": "git+https://github.com/crosswalk-project/cordova-plugin-crosswalk-webview.git", "cordova-plugin-device": "^2.0.2", "cordova-plugin-dialogs": "^2.0.2", + "cordova-plugin-fcm-with-dependecy-updated": "^7.8.0", "cordova-plugin-file": "^6.0.2", "cordova-plugin-fingerprint-aio": "^4.0.2", "cordova-plugin-globalization": "^1.11.0", @@ -152,8 +154,6 @@ "cordova-plugin-media": "^5.0.3", "cordova-plugin-media-capture": "^3.0.3", "cordova-plugin-mfp": "^8.0.2021031007", - "cordova-plugin-mfp-jsonstore": "^8.0.2021062408", - "cordova-plugin-mfp-push": "^8.0.2021062405", "cordova-plugin-network-information": "^3.0.0", "cordova-plugin-screen-orientation": "^3.0.2", "cordova-plugin-splashscreen": "^5.0.2", @@ -191,12 +191,17 @@ "cordova-plugin-androidx": {}, "cordova-plugin-androidx-adapter": {}, "cordova-plugin-fingerprint-aio": {}, - "cordova-plugin-mfp-push": {}, - "cordova-plugin-mfp-jsonstore": {}, "cordova-plugin-ionic-webview": {}, "cordova-plugin-screen-orientation": {}, "cordova-plugin-network-information": {}, - "cordova-plugin-file": {} + "cordova-plugin-file": {}, + "cordova-plugin-fcm-with-dependecy-updated": { + "ANDROID_GRADLE_TOOLS_VERSION": "4.1.0", + "ANDROID_GOOGLE_SERVICES_VERSION": "4.3.4", + "ANDROID_DEFAULT_NOTIFICATION_ICON": "@mipmap/ic_launcher", + "ANDROID_FCM_VERSION": "21.0.0", + "ANDROID_FIREBASE_BOM_VERSION": "26.0.0" + } }, "platforms": [ "browser", @@ -209,4 +214,4 @@ "url": "git+https://Kayaya@bitbucket.org/equilibriumito/gabinete-digital.git" }, "license": "ISC" -} +} \ No newline at end of file diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 05cf78fd0..447d26c0d 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -8,6 +8,7 @@ import * as _rollupMoment from 'moment'; import { NgxMatDateFormats } from '@angular-material-components/datetime-picker'; const moment = _rollupMoment || _moment; import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker'; +import { SqliteService } from 'src/app/services/sqlite.service'; import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx'; @@ -37,7 +38,8 @@ export class AppComponent { private platform: Platform, /* private splashScreen: SplashScreen, */ private statusBar: StatusBar, - private screenOrientation: ScreenOrientation + private screenOrientation: ScreenOrientation, + private sqliteservice: SqliteService ) { this.initializeApp(); } @@ -51,7 +53,19 @@ export class AppComponent { this.screenOrientation.unlock(); } else if( this.platform.is("mobile")) { this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.PORTRAIT_PRIMARY); + console.log('Orientation locked') } + + if (this.platform.is('desktop') || this.platform.is('mobileweb')) { + + } else { + try { + this.sqliteservice.databaseConn(); + } catch (error) { + console.log("Error creating local database: ", error) + } + } + }); } } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index d2048b241..780a22405 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -65,6 +65,8 @@ import { Media } from '@ionic-native/media/ngx'; import { StreamingMedia } from '@ionic-native/streaming-media/ngx'; import { PhotoViewer } from '@ionic-native/photo-viewer/ngx'; +import { FCM } from '@ionic-native/fcm/ngx'; + @NgModule({ declarations: [AppComponent], entryComponents: [], @@ -111,7 +113,7 @@ import { PhotoViewer } from '@ionic-native/photo-viewer/ngx'; //File, WebView, FilePath, - //FCM, + FCM, WebsocketService, ChatService, ScreenOrientation, diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts index 29b5a962a..dee9340a9 100644 --- a/src/app/home/home.page.ts +++ b/src/app/home/home.page.ts @@ -1,7 +1,7 @@ /* eslint-disable */ /* tslint:disable */ /// -/// +/* /// */ import { Component, OnInit, NgZone } from '@angular/core'; import { Event } from '../models/event.model'; import { NotificationsService } from '../services/notifications.service'; @@ -123,8 +123,9 @@ export class HomePage implements OnInit { this.webnotification.webconnection(); this.webnotification.register(); } else { - this.mobilefirstConnect(); this.notificationsService.onReceviNotification(); + //this.mobilefirstConnect(); + //this.notificationsService.onReceviNotification(); this.offlinemanager.synchnize() } }); @@ -144,7 +145,7 @@ export class HomePage implements OnInit { myWorker.postMessage('ali'); } - mobilefirstConnect() { + /* mobilefirstConnect() { console.log("Mobileconecct"); @@ -175,11 +176,11 @@ export class HomePage implements OnInit { /* this.zone.run(() => { console.log("Bummer..."); console.log("Failed to connect to MobileFirst Server"); - }); */ + }); }); } } - } + } */ diff --git a/src/app/modals/profile/profile.page.ts b/src/app/modals/profile/profile.page.ts index 218084254..57f7bffcb 100644 --- a/src/app/modals/profile/profile.page.ts +++ b/src/app/modals/profile/profile.page.ts @@ -1,5 +1,5 @@ /// -/// +/* /// */ import { Component, OnInit, NgZone } from '@angular/core'; import { Router, NavigationExtras } from '@angular/router'; import { AnimationController, ModalController,Platform } from '@ionic/angular'; diff --git a/src/app/pages/agenda/agenda.page.ts b/src/app/pages/agenda/agenda.page.ts index f1d47b0f3..54cace2f4 100644 --- a/src/app/pages/agenda/agenda.page.ts +++ b/src/app/pages/agenda/agenda.page.ts @@ -735,6 +735,7 @@ export class AgendaPage implements OnInit { Profile: profile } this.sqliteservice.addEvent(event) + }); } } diff --git a/src/app/pages/events/events.page.ts b/src/app/pages/events/events.page.ts index b431827ee..bae0452a5 100644 --- a/src/app/pages/events/events.page.ts +++ b/src/app/pages/events/events.page.ts @@ -78,7 +78,7 @@ export class EventsPage implements OnInit { loggeduser: LoginUserRespose; - existingScreenOrientation: string; + /* existingScreenOrientation: string; */ constructor( private eventService: EventsService, @@ -97,8 +97,8 @@ export class EventsPage implements OnInit { private backgroundservice: BackgroundService, public ThemeService: ThemeService ) { - this.existingScreenOrientation = this.screenOrientation.type; - console.log(this.existingScreenOrientation); + /* this.existingScreenOrientation = this.screenOrientation.type; + console.log(this.existingScreenOrientation); */ this.loggeduser = authService.ValidatedUser; @@ -109,13 +109,7 @@ export class EventsPage implements OnInit { // console.log('Resize event detected'); }); - try { - this.sqliteservice.databaseConn(); - } catch (error) { - console.log("Error creating local database: ", error) - } - - + window['zipPhoneCallback'] = function (zipphone) { var frame = document.getElementById('home-iframe'); if(frame) { @@ -172,22 +166,22 @@ export class EventsPage implements OnInit { } // Lock to portrait - lockToPortrait() { +/* lockToPortrait() { this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.PORTRAIT); console.log('set'); - } + } */ // Lock to landscape - lockToLandscape() { + /* lockToLandscape() { this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE); - } + } */ // Unlock screen orientation - unlockScreenOrientation() { + /* unlockScreenOrientation() { this.screenOrientation.unlock(); - } + } */ - checkScreenOrientation() { + /* checkScreenOrientation() { if (window.innerWidth < 701) { this.lockToPortrait(); console.log('was here'); @@ -196,7 +190,7 @@ export class EventsPage implements OnInit { else { this.unlockScreenOrientation(); } - } + } */ async RefreshEvents() { this.currentEvent = ""; @@ -329,6 +323,18 @@ export class EventsPage implements OnInit { } } + addProcessToDb(list) { + + if (this.platform.is('desktop') || this.platform.is('mobileweb')) { + } else { + if (list.length > 0) { + list.forEach(element => { + this.sqliteservice.addProcess(element) + }); + } + } + } + getEventsFromLocalDb() { let date = new Date(); @@ -463,14 +469,7 @@ export class EventsPage implements OnInit { LoadList() { this.processes.GetTaskListExpediente(false).subscribe(result => { console.log("Expediente", result); - - if (this.platform.is('desktop') || this.platform.is('mobileweb')) { - - } else { - result.forEach((element) => { - this.sqliteservice.addProcess(element) - }) - } + this.addProcessToDb(result); const ExpedienteTask = result.map(e => this.expedienteTaskPipe.transform(e)) diff --git a/src/app/pages/inactivity/inactivity.page.ts b/src/app/pages/inactivity/inactivity.page.ts index 7ae1e66c6..20b3a67c4 100644 --- a/src/app/pages/inactivity/inactivity.page.ts +++ b/src/app/pages/inactivity/inactivity.page.ts @@ -141,7 +141,7 @@ export class InactivityPage implements OnInit { } getToken() { - this.notificatinsservice.getAndpostToken(this.username); + //this.notificatinsservice.getAndpostToken(this.username); } setCode(code: string) { diff --git a/src/app/services/jsonStore.service.ts b/src/app/services/jsonStore.service.ts index 59a25bd7b..a87920299 100644 --- a/src/app/services/jsonStore.service.ts +++ b/src/app/services/jsonStore.service.ts @@ -1,5 +1,5 @@ /// -/// +/* /// */ import { Injectable } from "@angular/core"; @Injectable({ @@ -8,7 +8,7 @@ import { Injectable } from "@angular/core"; export class JsonStore { - createCollection(name, data) { +/* createCollection(name, data) { var collectionName = name; var addOptions = { @@ -108,7 +108,7 @@ export class JsonStore { replaceDocument(collectionName: string, document: any) { /* var document = { Example of how identify the document to replace _id: 1, json: {name: 'chevy', age: 23} - }; */ + }; var options = {}; WL.JSONStore.get(collectionName).replace(document, options).then(function (numberOfDocsReplaced) { @@ -119,12 +119,12 @@ export class JsonStore { } removeDocument(collectionName: any,query: any,) { - /* var query = { _id: 1 }; Exemple of query*/ + /* var query = { _id: 1 }; Exemple of query var options = { exact: true }; WL.JSONStore.get(collectionName).remove(query, options).then(function (numberOfDocsRemoved) { console.log("JsonStore remove document sucess: ", numberOfDocsRemoved) }).fail(function (error) { console.log("JsonStore remove document erro: ", error) }); - } + } */ } \ No newline at end of file diff --git a/src/app/services/notifications.service.ts b/src/app/services/notifications.service.ts index 6f7fec31e..4cb62c7cb 100644 --- a/src/app/services/notifications.service.ts +++ b/src/app/services/notifications.service.ts @@ -1,6 +1,6 @@ /* eslint-disable */ /* tslint:disable */ -/// +/* /// */ import { Injectable, NgZone } from '@angular/core'; import { ActivatedRoute } from '@angular/router' import { HttpClient } from '@angular/common/http'; @@ -17,6 +17,8 @@ import { v4 as uuidv4 } from 'uuid'; import { EventTrigger } from '../services/eventTrigger.service'; import { SessionStore } from '../store/session.service'; +import { FCM } from '@ionic-native/fcm/ngx'; + @Injectable({ providedIn: 'root' }) @@ -45,7 +47,8 @@ export class NotificationsService { private activeroute: ActivatedRoute, private jsonstore: JsonStore, private eventtrigger: EventTrigger, - private backgroundservice: BackgroundService) { + private backgroundservice: BackgroundService, + private fcm: FCM) { this.storageService.get("Notifications").then((value) => { @@ -85,6 +88,67 @@ export class NotificationsService { } getAndpostToken(username) { + if(this.platform.is('desktop') || this.platform.is('mobileweb')) { + console.log('Notifications not supported') + } else { + + const geturl = environment.apiURL + 'notifications/token'; + + return this.fcm.getToken().then(token => { + console.log('token: ', token) + this.storageService.store(username, token); + this.storageService.get(username).then(value => { + console.log('STORAGE TOKEN', value) + this.storageService.get(AuthConnstants.USER).then(res => { + console.log('USERID', res); + const headers = { 'Authorization': SessionStore.user.BasicAuthKey }; + const body = { + UserId: res.UserId, + TokenId: token, + Status: 1, + Service: 1 + }; + + this.http.post(`${geturl}`, body, { headers }).subscribe(data => { + console.log('TOKEN USER MIDLE', data); + }) + }); + + }); + }); + } + + } + + async onReceviNotification() { + this.fcm.onNotification().subscribe(data => { + if (data.click_action) { + console.log("Received in background: ", data); + + this.notificatinsRoutes(data) + + } /* else { + console.log("Received in foreground: ", data); + + console.log(data.Service) + console.log(data.Object) + console.log(data.IdObject) + this.openApproveModal(data.IdObject); + + }; */ + }); + } + + + ///////////////////////////////////////////////////// + + /* getTokenByUserIdAndId(user, userID) { + const geturl = environment.apiURL + 'notifications/user/' + userID; + + return this.http.get(`${geturl}`); + } + */ +/* getAndpostToken(username) { if (this.platform.is('desktop') || this.platform.is('mobileweb')) { //console.log('Notifications not supported') @@ -144,13 +208,13 @@ export class NotificationsService { } - } + } */ tempClearArray(){ this.DataArray = []; } - async onReceviNotification() { +/* async onReceviNotification() { if(window['WLAuthorizationManager']) { if(window['WLAuthorizationManager'].obtainAccessToken) { @@ -188,7 +252,7 @@ export class NotificationsService { if(message.actionName){ this.notificatinsRoutes(data); } else { - /* this.toastService.notificationMessage(message.alert,this.notificatinsRoutes, data); */ + /* this.toastService.notificationMessage(message.alert,this.notificatinsRoutes, data); //this.notificatinsRoutes(data); console.log(data) } @@ -209,7 +273,7 @@ export class NotificationsService { } - } + } */ notificatinsRoutes = (data) => { if (data.Service === "agenda") { diff --git a/src/app/services/sqlite.service.ts b/src/app/services/sqlite.service.ts index c1f13cde1..2330d7aaf 100644 --- a/src/app/services/sqlite.service.ts +++ b/src/app/services/sqlite.service.ts @@ -34,6 +34,7 @@ export class SqliteService { location: 'default' }).then(async (sqLite: SQLiteObject) => { this.dbInstance = sqLite; + console.log('SQLITE INSTACE ',this.dbInstance); await sqLite.executeSql(` CREATE TABLE IF NOT EXISTS ${this.events} ( EventId varchar(255) PRIMARY KEY, From d7745a1ed3797d9a16f459bdc0ba222f16a16538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eudes=20In=C3=A1cio?= Date: Wed, 3 Nov 2021 12:21:19 +0100 Subject: [PATCH 2/9] Some changes --- config.xml | 2 + package-lock.json | 128 ++++++++- package.json | 42 ++- src/app/app.module.ts | 3 + src/app/home/home.page.ts | 93 ++++--- src/app/home/nice.worker.js | 4 +- src/app/pages/events/events.page.ts | 6 + src/app/services/notifications.service.ts | 323 +++++++++++----------- src/app/services/sqlite.service.ts | 9 +- 9 files changed, 392 insertions(+), 218 deletions(-) diff --git a/config.xml b/config.xml index bd410ebfa..9b098f8e2 100644 --- a/config.xml +++ b/config.xml @@ -20,6 +20,7 @@ + @@ -91,4 +92,5 @@ 2 + diff --git a/package-lock.json b/package-lock.json index ae4d69471..a683b2ea7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2235,6 +2235,21 @@ "resolved": "https://registry.npmjs.org/@ionic-native/fingerprint-aio/-/fingerprint-aio-4.20.0.tgz", "integrity": "sha512-DhdXVG7gdBtCwYHDAsNazIcMlyt6X968ilA/5Rt8uFd+xN4Un5gZteOJCVn9xWDC/ZqhO/QAq2M0BIGyEhzW0g==" }, + "@ionic-native/firebase-x": { + "version": "5.36.0", + "resolved": "https://registry.npmjs.org/@ionic-native/firebase-x/-/firebase-x-5.36.0.tgz", + "integrity": "sha512-h6jfTFqvABwugir5tsAzyvUWdu0EZg1PnWW0EkQy3CRg/qQlcjiDJW8pqyq1l84UDJQ7fxiTvbmX0Jod2BFE3w==", + "requires": { + "@types/cordova": "^0.0.34" + }, + "dependencies": { + "@types/cordova": { + "version": "0.0.34", + "resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz", + "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ=" + } + } + }, "@ionic-native/http": { "version": "5.36.0", "resolved": "https://registry.npmjs.org/@ionic-native/http/-/http-5.36.0.tgz", @@ -5288,6 +5303,15 @@ } } }, + "bplist-creator": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.1.0.tgz", + "integrity": "sha512-sXaHZicyEEmY86WyueLTQesbeoH/mquvarJaQNbjuOQO+7gbFcDEWqKmcWA4cOTLzFlfgvkiVxolk1k5bBIpmg==", + "dev": true, + "requires": { + "stream-buffers": "2.2.x" + } + }, "bplist-parser": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz", @@ -6963,10 +6987,9 @@ "integrity": "sha1-C8ZXVyduvZIMASzpIOJ0F3V2Nz4=", "dev": true }, - "cordova-plugin-crosswalk-webview": { - "version": "git+https://github.com/crosswalk-project/cordova-plugin-crosswalk-webview.git#58dda06c97609c6a0699b8d0691ad603901625ce", - "from": "git+https://github.com/crosswalk-project/cordova-plugin-crosswalk-webview.git", - "dev": true + "cordova-plugin-dbcopy": { + "version": "git+https://github.com/an-rahulpandey/cordova-plugin-dbcopy.git#861f585e4313db828d6b8c7d354c32c83373d0d2", + "from": "git+https://github.com/an-rahulpandey/cordova-plugin-dbcopy.git" }, "cordova-plugin-device": { "version": "2.0.3", @@ -6981,12 +7004,20 @@ "dev": true }, "cordova-plugin-fcm-with-dependecy-updated": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/cordova-plugin-fcm-with-dependecy-updated/-/cordova-plugin-fcm-with-dependecy-updated-7.8.0.tgz", - "integrity": "sha512-p2pbY1oqQ2UDbaWOWA2z84uMXmdDGYmK2O+mrufj1bZyoFodt7WqrtiB9oDnUuSSinMrdNFrupiWEDMSBSNVeQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/cordova-plugin-fcm-with-dependecy-updated/-/cordova-plugin-fcm-with-dependecy-updated-7.2.0.tgz", + "integrity": "sha512-Iv1gOeoQ4l/1ztBLemgLOCS4iaVemHezfpa5/X+iqS4apfvUVLJ47Vw6KO7deBO2d2ElvrGZ2ayZX7j3uhtsRw==", "dev": true, "requires": { - "typescript": "^4.1.3" + "typescript": "^3.9.6" + }, + "dependencies": { + "typescript": { + "version": "3.9.10", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", + "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", + "dev": true + } } }, "cordova-plugin-file": { @@ -7006,6 +7037,18 @@ "integrity": "sha512-Mmm/Ee85s4JH7qL3yikQ2J2I2vY2XbNi1fttoEK2kI++YHr/WeqPHWGREFL7bmFYjZTph/JovhfWHPGV924WjQ==", "dev": true }, + "cordova-plugin-firebasex": { + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/cordova-plugin-firebasex/-/cordova-plugin-firebasex-13.0.1.tgz", + "integrity": "sha512-p9V8tJzT5ouRKhfz9Vo6uEdv0BvMJldXBrrw61H/0smT5JzJFcHu/BekhbIsF5yrpBSIwdSK15JA04JA4EtL3w==", + "dev": true, + "requires": { + "plist": "^3.0.1", + "semver": "^7.3.2", + "xcode": "^3.0.1", + "xml-js": "^1.6.11" + } + }, "cordova-plugin-globalization": { "version": "1.11.0", "resolved": "https://registry.npmjs.org/cordova-plugin-globalization/-/cordova-plugin-globalization-1.11.0.tgz", @@ -10139,6 +10182,12 @@ "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", "dev": true }, + "es6-promise-plugin": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/es6-promise-plugin/-/es6-promise-plugin-4.2.2.tgz", + "integrity": "sha512-uoA4aVplXI9oqUYJFBAVRwAqIN9/n9JgrTAUGX3qPbnSZVE5yY1+6/MsoN5f4xsaPO62WjPHOdtts6okMN6tNA==", + "dev": true + }, "es6-promisify": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", @@ -21053,6 +21102,28 @@ } } }, + "simple-plist": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/simple-plist/-/simple-plist-1.3.0.tgz", + "integrity": "sha512-uYWpeGFtZtVt2NhG4AHgpwx323zxD85x42heMJBan1qAiqqozIlaGrwrEt6kRjXWRWIXsuV1VLCvVmZan2B5dg==", + "dev": true, + "requires": { + "bplist-creator": "0.1.0", + "bplist-parser": "0.3.0", + "plist": "^3.0.4" + }, + "dependencies": { + "bplist-parser": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.0.tgz", + "integrity": "sha512-zgmaRvT6AN1JpPPV+S0a1/FAtoxSreYDccZGIqEMSvZl9DMe70mJ7MFzpxa1X+gHVdkToE2haRUHHMiW1OdejA==", + "dev": true, + "requires": { + "big-integer": "1.6.x" + } + } + } + }, "simple-swizzle": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", @@ -21624,6 +21695,12 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" }, + "stream-buffers": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/stream-buffers/-/stream-buffers-2.2.0.tgz", + "integrity": "sha1-kdX1Ew0c75bc+n9yaUUYh0HQnuQ=", + "dev": true + }, "stream-throttle": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/stream-throttle/-/stream-throttle-0.1.3.tgz", @@ -25031,11 +25108,46 @@ "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz", "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==" }, + "xcode": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/xcode/-/xcode-3.0.1.tgz", + "integrity": "sha512-kCz5k7J7XbJtjABOvkc5lJmkiDh8VhjVCGNiqdKCscmVpdVUpEAyXv1xmCLkQJ5dsHqx3IPO4XW+NTDhU/fatA==", + "dev": true, + "requires": { + "simple-plist": "^1.1.0", + "uuid": "^7.0.3" + }, + "dependencies": { + "uuid": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz", + "integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==", + "dev": true + } + } + }, "xdg-basedir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==" }, + "xml-js": { + "version": "1.6.11", + "resolved": "https://registry.npmjs.org/xml-js/-/xml-js-1.6.11.tgz", + "integrity": "sha512-7rVi2KMfwfWFl+GpPg6m80IVMWXLRjO+PxTq7V2CDhoGak0wzYzFgUY2m4XJ47OGdXd8eLE8EmwfAmdjw7lC1g==", + "dev": true, + "requires": { + "sax": "^1.2.4" + }, + "dependencies": { + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true + } + } + }, "xml-name-validator": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", diff --git a/package.json b/package.json index 980b14a9c..1fcb3461e 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "@ionic-native/file": "^5.36.0", "@ionic-native/file-path": "^5.30.0", "@ionic-native/fingerprint-aio": "^4.20.0", + "@ionic-native/firebase-x": "^5.36.0", "@ionic-native/http": "^5.31.1", "@ionic-native/image-picker": "^5.36.0", "@ionic-native/in-app-browser": "^5.28.0", @@ -79,6 +80,7 @@ "build": "0.1.4", "ci": "^2.1.1", "cordova": "^10.0.0", + "cordova-plugin-dbcopy": "git+https://github.com/an-rahulpandey/cordova-plugin-dbcopy.git", "cordova-plugin-filepath": "^1.5.8", "cordova-plugin-okhttp": "^2.0.0", "cordova-res": "^0.15.3", @@ -141,12 +143,12 @@ "cordova-plugin-androidx": "^3.0.0", "cordova-plugin-androidx-adapter": "^1.1.3", "cordova-plugin-compat": "^1.2.0", - "cordova-plugin-crosswalk-webview": "git+https://github.com/crosswalk-project/cordova-plugin-crosswalk-webview.git", "cordova-plugin-device": "^2.0.2", "cordova-plugin-dialogs": "^2.0.2", - "cordova-plugin-fcm-with-dependecy-updated": "^7.8.0", + "cordova-plugin-fcm-with-dependecy-updated": "^7.2.0", "cordova-plugin-file": "^6.0.2", "cordova-plugin-fingerprint-aio": "^4.0.2", + "cordova-plugin-firebasex": "^13.0.1", "cordova-plugin-globalization": "^1.11.0", "cordova-plugin-inappbrowser": "^4.0.0", "cordova-plugin-ionic-keyboard": "^2.2.0", @@ -161,6 +163,7 @@ "cordova-plugin-streaming-media": "^2.3.0", "cordova-plugin-telerik-imagepicker": "^2.3.6", "cordova-plugin-whitelist": "^1.3.4", + "es6-promise-plugin": "^4.2.2", "jasmine-core": "~3.6.0", "jasmine-spec-reporter": "~5.0.0", "jest": "^27.0.6", @@ -195,13 +198,36 @@ "cordova-plugin-screen-orientation": {}, "cordova-plugin-network-information": {}, "cordova-plugin-file": {}, + "cordova-plugin-firebasex": { + "FIREBASE_ANALYTICS_COLLECTION_ENABLED": "true", + "FIREBASE_PERFORMANCE_COLLECTION_ENABLED": "true", + "FIREBASE_CRASHLYTICS_COLLECTION_ENABLED": "true", + "ANDROID_ICON_ACCENT": "#FF00FFFF", + "ANDROID_FIREBASE_PERFORMANCE_MONITORING": "false", + "ANDROID_PLAY_SERVICES_TAGMANAGER_VERSION": "17.0.0", + "ANDROID_PLAY_SERVICES_AUTH_VERSION": "19.0.0", + "ANDROID_FIREBASE_ANALYTICS_VERSION": "19.0.0", + "ANDROID_FIREBASE_MESSAGING_VERSION": "22.0.0", + "ANDROID_FIREBASE_CONFIG_VERSION": "21.0.0", + "ANDROID_FIREBASE_PERF_VERSION": "20.0.2", + "ANDROID_FIREBASE_AUTH_VERSION": "21.0.1", + "ANDROID_FIREBASE_INAPPMESSAGING_VERSION": "20.0.0", + "ANDROID_FIREBASE_FIRESTORE_VERSION": "23.0.2", + "ANDROID_FIREBASE_FUNCTIONS_VERSION": "20.0.0", + "ANDROID_FIREBASE_IID_VERSION": "21.1.0", + "ANDROID_FIREBASE_INSTALLATIONS_VERSION": "17.0.0", + "ANDROID_FIREBASE_CRASHLYTICS_VERSION": "18.1.0", + "ANDROID_FIREBASE_CRASHLYTICS_NDK_VERSION": "18.1.0", + "ANDROID_GSON_VERSION": "2.8.7", + "ANDROID_FIREBASE_PERF_GRADLE_PLUGIN_VERSION": "1.4.0" + }, "cordova-plugin-fcm-with-dependecy-updated": { - "ANDROID_GRADLE_TOOLS_VERSION": "4.1.0", - "ANDROID_GOOGLE_SERVICES_VERSION": "4.3.4", - "ANDROID_DEFAULT_NOTIFICATION_ICON": "@mipmap/ic_launcher", - "ANDROID_FCM_VERSION": "21.0.0", - "ANDROID_FIREBASE_BOM_VERSION": "26.0.0" - } + "ANDROID_FCM_VERSION": "19.0.0", + "ANDROID_GRADLE_TOOLS_VERSION": "3.5.3", + "ANDROID_GOOGLE_SERVICES_VERSION": "4.3.3", + "ANDROID_DEFAULT_NOTIFICATION_ICON": "@mipmap/ic_launcher" + }, + "cordova-plugin-dbcopy": {} }, "platforms": [ "browser", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 780a22405..22ca48f4a 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -66,6 +66,8 @@ import { StreamingMedia } from '@ionic-native/streaming-media/ngx'; import { PhotoViewer } from '@ionic-native/photo-viewer/ngx'; import { FCM } from '@ionic-native/fcm/ngx'; +import { FirebaseX } from '@ionic-native/firebase-x/ngx'; +//import { FCM } from 'cordova-plugin-fcm-with-dependecy-updated/ionic/ngx'; @NgModule({ declarations: [AppComponent], @@ -114,6 +116,7 @@ import { FCM } from '@ionic-native/fcm/ngx'; WebView, FilePath, FCM, + FirebaseX, WebsocketService, ChatService, ScreenOrientation, diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts index dee9340a9..f989804a9 100644 --- a/src/app/home/home.page.ts +++ b/src/app/home/home.page.ts @@ -26,6 +26,8 @@ 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', @@ -86,7 +88,8 @@ export class HomePage implements OnInit { private offlinemanager: OfflineManagerService, private storage: Storage, private eventservice: EventsService, - private screenOrientation: ScreenOrientation) { + private screenOrientation: ScreenOrientation, + private firebaseX: FirebaseX) { this.webNotificationPopupService.askNotificationPermission() @@ -116,6 +119,18 @@ export class HomePage implements OnInit { ngOnInit() { + 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() @@ -136,51 +151,51 @@ export class HomePage implements OnInit { this.updateList() - var myWorker = new Worker(new URL('./nice.worker.js', import.meta.url)); + /* var myWorker = new Worker(new URL('./nice.worker.js', import.meta.url)); myWorker.onmessage = function (oEvent) { console.log('Worker said : ' + oEvent.data); } - myWorker.postMessage('ali'); + 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"); - }); - }); - } - } - } */ + /* 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"); + }); + }); + } + } + } */ diff --git a/src/app/home/nice.worker.js b/src/app/home/nice.worker.js index ce71defff..508e44345 100644 --- a/src/app/home/nice.worker.js +++ b/src/app/home/nice.worker.js @@ -1,5 +1,5 @@ -postMessage("I\'m working before postMessage(\'ali\')."); +/* postMessage("I\'m working before postMessage(\'ali\')."); onmessage = function(oEvent) { postMessage('Hi ' + oEvent.data); -}; \ No newline at end of file +}; */ \ No newline at end of file diff --git a/src/app/pages/events/events.page.ts b/src/app/pages/events/events.page.ts index bae0452a5..5648ca0f7 100644 --- a/src/app/pages/events/events.page.ts +++ b/src/app/pages/events/events.page.ts @@ -121,6 +121,12 @@ export class EventsPage implements OnInit { ngOnInit() { + try { + this.sqliteservice.databaseConn(); + } catch (error) { + console.log("Error creating local database: ", error) + } + this.segment = "Combinada"; this.profile = "mdgpr"; diff --git a/src/app/services/notifications.service.ts b/src/app/services/notifications.service.ts index 4cb62c7cb..b24689d0b 100644 --- a/src/app/services/notifications.service.ts +++ b/src/app/services/notifications.service.ts @@ -9,7 +9,7 @@ import { StorageService } from 'src/app/services/storage.service'; import { AuthConnstants } from 'src/app/config/auth-constants'; import { Token } from '../models/token.model'; import { ModalController, AlertController, AnimationController, Platform } from '@ionic/angular'; -import { NavigationExtras,Router } from '@angular/router'; +import { NavigationExtras, Router } from '@angular/router'; import { ToastService } from '../services/toast.service'; import { JsonStore } from './jsonStore.service'; import { BackgroundService } from './background.service'; @@ -18,6 +18,7 @@ import { EventTrigger } from '../services/eventTrigger.service'; import { SessionStore } from '../store/session.service'; import { FCM } from '@ionic-native/fcm/ngx'; +//import { FCM } from 'cordova-plugin-fcm-with-dependecy-updated/ionic/ngx'; @Injectable({ providedIn: 'root' @@ -41,38 +42,38 @@ export class NotificationsService { public modalCtrl: AlertController, private animationController: AnimationController, private platform: Platform, - private router: Router, + private router: Router, private toastService: ToastService, private zone: NgZone, private activeroute: ActivatedRoute, private jsonstore: JsonStore, private eventtrigger: EventTrigger, private backgroundservice: BackgroundService, - private fcm: FCM) { + private fcm: FCM) { - this.storageService.get("Notifications").then((value) => { - - }).catch(()=>{ + this.storageService.get("Notifications").then((value) => { - this.storageService.store("Notifications",[]) - }) + }).catch(() => { - } + this.storageService.store("Notifications", []) + }) - registerCallback(type: string, funx: Function, object: any = {} ) { + } + + registerCallback(type: string, funx: Function, object: any = {}) { const id = uuidv4() - this.callbacks.push({type, funx, id}) - if(!object.hasOwnProperty('desktop') && object['desktop'] != false) { - this.backgroundservice.registerBackService('Notification',funx, type) + this.callbacks.push({ type, funx, id }) + if (!object.hasOwnProperty('desktop') && object['desktop'] != false) { + this.backgroundservice.registerBackService('Notification', funx, type) } return id; } deleteCallback(id) { - this.callbacks.forEach((e, index)=>{ - if(e.id == id) { + this.callbacks.forEach((e, index) => { + if (e.id == id) { if (index > -1) { this.callbacks.splice(index, 1); } @@ -88,36 +89,36 @@ export class NotificationsService { } getAndpostToken(username) { - if(this.platform.is('desktop') || this.platform.is('mobileweb')) { + if (this.platform.is('desktop') || this.platform.is('mobileweb')) { console.log('Notifications not supported') } else { - + const geturl = environment.apiURL + 'notifications/token'; - return this.fcm.getToken().then(token => { - console.log('token: ', token) - this.storageService.store(username, token); - this.storageService.get(username).then(value => { - console.log('STORAGE TOKEN', value) - this.storageService.get(AuthConnstants.USER).then(res => { - console.log('USERID', res); - const headers = { 'Authorization': SessionStore.user.BasicAuthKey }; - const body = { - UserId: res.UserId, - TokenId: token, - Status: 1, - Service: 1 - }; + return this.fcm.getToken().then(token => { + console.log('token: ', token) + this.storageService.store(username, token); + this.storageService.get(username).then(value => { + console.log('STORAGE TOKEN', value) + this.storageService.get(AuthConnstants.USER).then(res => { + console.log('USERID', res); + const headers = { 'Authorization': SessionStore.user.BasicAuthKey }; + const body = { + UserId: res.UserId, + TokenId: token, + Status: 1, + Service: 1 + }; + + this.http.post(`${geturl}`, body, { headers }).subscribe(data => { + console.log('TOKEN USER MIDLE', data); + }) + }); - this.http.post(`${geturl}`, body, { headers }).subscribe(data => { - console.log('TOKEN USER MIDLE', data); - }) }); - }); - }); } - + } async onReceviNotification() { @@ -127,15 +128,19 @@ export class NotificationsService { this.notificatinsRoutes(data) - } /* else { + } else { console.log("Received in foreground: ", data); console.log(data.Service) console.log(data.Object) console.log(data.IdObject) - this.openApproveModal(data.IdObject); - - }; */ + + /* this.DataArray.push(data) + console.log("On ReceiveNotification", this.DataArray) + this.storageService.store("Notifications", this.DataArray) */ + + + }; }); } @@ -148,56 +153,122 @@ export class NotificationsService { return this.http.get(`${geturl}`); } */ -/* getAndpostToken(username) { + /* getAndpostToken(username) { + + if (this.platform.is('desktop') || this.platform.is('mobileweb')) { + //console.log('Notifications not supported') + } else { + + const geturl = environment.apiURL + 'notifications/token'; + if(window['WLAuthorizationManager']) { + if(window['WLAuthorizationManager'].obtainAccessToken) { + window['WLAuthorizationManager'].obtainAccessToken("push.mobileclient").then( + (token) => { + console.log('Push Notification: Success ' + token); + + window['MFPPush'].initialize( + function (successResponse) { + console.log("Push notification Successfully Service intialized: " + successResponse); + }, + function (failureResponse) { + console.log("Push notification failure Service intialized: " + failureResponse); + } + ); + + window['MFPPush'].registerDevice(null, async (successResponse) => { + console.log("Successfully registered: " + JSON.stringify(successResponse)); + console.log('token: ', successResponse.deviceId) + await this.storageService.store(username, successResponse.deviceId).then((tokennoti) => { + console.log('token store',tokennoti) + }); + await this.storageService.get(username).then(value => { + console.log('STORAGE TOKEN', value) + this.storageService.get(AuthConnstants.USER).then(res => { + console.log('USERID', res); + const headers = { 'Authorization': SessionStore.user.BasicAuthKey }; + const body = { + UserId: res.UserId, + TokenId: successResponse.deviceId, + Status: 1, + Service: 1 + }; + this.http.post(`${geturl}`, body, { headers }).subscribe(data => { + console.log('TOKEN USER MIDLE', data); + }) + }); + + }); + }, + function (failureResponse) { + console.log("Successfully failue: " + JSON.stringify(failureResponse)); + } + ); + }, (error) => { + console.log('Push notification recived: failure ' + error.responseText); + console.log(JSON.stringify(error)); + } + ); + } + } + + } + + } */ - if (this.platform.is('desktop') || this.platform.is('mobileweb')) { - //console.log('Notifications not supported') - } else { + tempClearArray() { + this.DataArray = []; + } - const geturl = environment.apiURL + 'notifications/token'; + /* async onReceviNotification() { + if(window['WLAuthorizationManager']) { if(window['WLAuthorizationManager'].obtainAccessToken) { window['WLAuthorizationManager'].obtainAccessToken("push.mobileclient").then( (token) => { console.log('Push Notification: Success ' + token); - + window['MFPPush'].initialize( function (successResponse) { - console.log("Push notification Successfully Service intialized: " + successResponse); + console.log("Push notification Successfully intialized: " + successResponse); + window['MFPPush'].registerNotificationsCallback(notificationReceived); }, function (failureResponse) { - console.log("Push notification failure Service intialized: " + failureResponse); + console.log("Push notification failure intialized: " + failureResponse); } ); - - window['MFPPush'].registerDevice(null, async (successResponse) => { - console.log("Successfully registered: " + JSON.stringify(successResponse)); - console.log('token: ', successResponse.deviceId) - await this.storageService.store(username, successResponse.deviceId).then((tokennoti) => { - console.log('token store',tokennoti) - }); - await this.storageService.get(username).then(value => { - console.log('STORAGE TOKEN', value) - this.storageService.get(AuthConnstants.USER).then(res => { - console.log('USERID', res); - const headers = { 'Authorization': SessionStore.user.BasicAuthKey }; - const body = { - UserId: res.UserId, - TokenId: successResponse.deviceId, - Status: 1, - Service: 1 - }; - this.http.post(`${geturl}`, body, { headers }).subscribe(data => { - console.log('TOKEN USER MIDLE', data); - }) - }); - - }); - }, - function (failureResponse) { - console.log("Successfully failue: " + JSON.stringify(failureResponse)); + var notificationReceived = (message) => { + //this.jsonstore.createCollection('Notifications',message); + this.DataArray.push(message) + console.log("On ReceiveNotification", this.DataArray) + this.storageService.store("Notifications",this.DataArray) + + console.log(message); + this.eventtrigger.publishSomeData({ + notification: "recive" + }) + var data = JSON.parse(message.payload); + + //synchro.$send(data) + + console.log('data.Service', data.Service); // module + console.log('data.IdObject', data.IdObject); // Object id + console.log('data.Object', data.Object); // details + + if(message.actionName){ + this.notificatinsRoutes(data); + } else { + /* this.toastService.notificationMessage(message.alert,this.notificatinsRoutes, data); + //this.notificatinsRoutes(data); + console.log(data) } - ); + + this.callbacks.forEach( e=> { + if(e.type == data.Object || e.type == "any") { + e.funx() + } + }) + + } }, (error) => { console.log('Push notification recived: failure ' + error.responseText); console.log(JSON.stringify(error)); @@ -205,120 +276,54 @@ export class NotificationsService { ); } } - - } - - } */ - - tempClearArray(){ - this.DataArray = []; - } - -/* async onReceviNotification() { - - if(window['WLAuthorizationManager']) { - if(window['WLAuthorizationManager'].obtainAccessToken) { - window['WLAuthorizationManager'].obtainAccessToken("push.mobileclient").then( - (token) => { - console.log('Push Notification: Success ' + token); - - window['MFPPush'].initialize( - function (successResponse) { - console.log("Push notification Successfully intialized: " + successResponse); - window['MFPPush'].registerNotificationsCallback(notificationReceived); - }, - function (failureResponse) { - console.log("Push notification failure intialized: " + failureResponse); - } - ); - var notificationReceived = (message) => { - //this.jsonstore.createCollection('Notifications',message); - this.DataArray.push(message) - console.log("On ReceiveNotification", this.DataArray) - this.storageService.store("Notifications",this.DataArray) - - console.log(message); - this.eventtrigger.publishSomeData({ - notification: "recive" - }) - var data = JSON.parse(message.payload); - - //synchro.$send(data) - - console.log('data.Service', data.Service); // module - console.log('data.IdObject', data.IdObject); // Object id - console.log('data.Object', data.Object); // details - - if(message.actionName){ - this.notificatinsRoutes(data); - } else { - /* this.toastService.notificationMessage(message.alert,this.notificatinsRoutes, data); - //this.notificatinsRoutes(data); - console.log(data) - } - - this.callbacks.forEach( e=> { - if(e.type == data.Object || e.type == "any") { - e.funx() - } - }) - - } - }, (error) => { - console.log('Push notification recived: failure ' + error.responseText); - console.log(JSON.stringify(error)); - } - ); - } - } - - - } */ + + + } */ notificatinsRoutes = (data) => { if (data.Service === "agenda") { this.zone.run(() => this.router.navigate(['/home/agenda', data.IdObject, 'agenda'])); } else if (data.Service === "gabinete-digital" && data.Object === "expediente") { - this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente',data.IdObject,'gabinete-digital'])); + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expediente', data.IdObject, 'gabinete-digital'])); } else if (data.Service === "agenda" && data.Object === "event-list") { - this.zone.run(() => this.router.navigate(['/home/agenda/event-list/approve-event',data.IdObject, 'agenda'])); - }else if (data.Service === "gabinete-digital" && data.Object === "despachos") { + this.zone.run(() => this.router.navigate(['/home/agenda/event-list/approve-event', data.IdObject, 'agenda'])); + } else if (data.Service === "gabinete-digital" && data.Object === "despachos") { - this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos',data.IdObject,'gabinete-digital'],{replaceUrl: true})); + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos', data.IdObject, 'gabinete-digital'], { replaceUrl: true })); } else if (data.Service === "gabinete-digital" && data.Object === "parecer") { - this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos',data.IdObject,'gabinete-digital'])); + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', data.IdObject, 'gabinete-digital'])); } else if (data.Service === "gabinete-digital" && data.Object === "deferimento") { - this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos',data.IdObject,'gabinete-digital'])); + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/pedidos', data.IdObject, 'gabinete-digital'])); } else if (data.Service === "gabinete-digital" && data.Object === "despachos-pr") { - this.zone.run(() =>this.router.navigate(['/home/gabinete-digital/despachos-pr',data.IdObject,'gabinete-digital'])); + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/despachos-pr', data.IdObject, 'gabinete-digital'])); } else if (data.Service === "accoes" && data.Object === "accao") { - this.zone.run(() => this.router.navigate(['/home/publications',data.IdObject])); + this.zone.run(() => this.router.navigate(['/home/publications', data.IdObject])); } else if (data.Service === "accoes" && data.Object === "publicacao") { - this.zone.run(() => this.router.navigate(['/home/publications/view-publications',data.FolderId,data.IdObject])); + this.zone.run(() => this.router.navigate(['/home/publications/view-publications', data.FolderId, data.IdObject])); } else if (data.Service === "gabinete-digital" && data.Object === "diplomas") { - this.zone.run(() =>this.router.navigate(['/home/gabinete-digital/diplomas', data.IdObject, 'gabinete-digital'])); + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas', data.IdObject, 'gabinete-digital'])); } else if (data.Service === "gabinete-digital" && data.Object === "diplomas-assinar") { let navigationExtras: NavigationExtras = { queryParams: { - "serialNumber": data.IdObject, + "serialNumber": data.IdObject, } }; - this.zone.run(() =>this.router.navigate(['/home/gabinete-digital/diplomas-assinar/diploma-assinar'], navigationExtras)); + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/diplomas-assinar/diploma-assinar'], navigationExtras)); } else if (data.Service === "gabinete-digital" && data.Object === "expedientes-pr") { - this.zone.run(() =>this.router.navigate(['/home/gabinete-digital/expedientes-pr',data.IdObject,'gabinete-digital'])); + this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expedientes-pr', data.IdObject, 'gabinete-digital'])); } } diff --git a/src/app/services/sqlite.service.ts b/src/app/services/sqlite.service.ts index 2330d7aaf..c7ef44e7a 100644 --- a/src/app/services/sqlite.service.ts +++ b/src/app/services/sqlite.service.ts @@ -25,11 +25,14 @@ export class SqliteService { this.databaseConn(); } - databaseConn() { + databaseConn() { + console.log('SQLDBConnect') if (this.platform.is('desktop') || this.platform.is('mobileweb')) { } else { + console.log('SQLDBConnect22') this.platform.ready().then(async () => { - await this.sqlite.create({ + console.log('SQLDBConnect33') + this.sqlite.create({ name: this.db_name, location: 'default' }).then(async (sqLite: SQLiteObject) => { @@ -126,6 +129,8 @@ export class SqliteService { .catch((error) => console.log(JSON.stringify(error))); }) .catch((error) => console.log(JSON.stringify(error))); + }).catch((error) => { + console.log('Platform ready error', error) }); } } From 84f2c1cc36c9383dcd8fd8aed20c6c20b0a1c1a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eudes=20In=C3=A1cio?= Date: Thu, 4 Nov 2021 06:39:39 +0100 Subject: [PATCH 3/9] project migated to capacitor --- config.xml | 3 +- ionic.config.json | 5 +- package-lock.json | 1852 ++--------------- package.json | 15 +- src/app/app.module.ts | 8 +- src/app/home/home.page.ts | 76 +- src/app/modals/profile/profile.page.ts | 57 +- src/app/pages/chat/chat.page.ts | 2 +- .../gabinete-digital/gabinete-digital.page.ts | 4 +- src/app/pages/inactivity/inactivity.page.ts | 4 +- src/app/pages/login/login.page.ts | 6 +- src/app/services/jsonStore.service.spec.ts | 16 - src/app/services/jsonStore.service.ts | 130 -- src/app/services/notifications.service.ts | 17 +- src/app/shared/header/header.page.ts | 8 +- 15 files changed, 310 insertions(+), 1893 deletions(-) delete mode 100644 src/app/services/jsonStore.service.spec.ts delete mode 100644 src/app/services/jsonStore.service.ts diff --git a/config.xml b/config.xml index 9b098f8e2..59d2407be 100644 --- a/config.xml +++ b/config.xml @@ -20,7 +20,6 @@ - @@ -93,4 +92,6 @@ + + diff --git a/ionic.config.json b/ionic.config.json index aab0ef21f..dbff1f56b 100644 --- a/ionic.config.json +++ b/ionic.config.json @@ -1,10 +1,11 @@ { "name": "gabinete-digital", "integrations": { - "cordova": {} + "cordova": {}, + "capacitor": {} }, "type": "angular", - "proxies":[ + "proxies": [ { "path": "/mfp/api/imfpush/", "proxyUrl": "http://gpr-dev-10.gabinetedigital.local:9080/mfp/api/imfpush/" diff --git a/package-lock.json b/package-lock.json index a683b2ea7..857cf86e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2030,6 +2030,143 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "@capacitor/android": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@capacitor/android/-/android-3.3.0.tgz", + "integrity": "sha512-dzbzdN7KjjwpUbg7mZKVkgAVytEwGyXUL4Z1t9c12UhViJaNjU7/nSlTXjb+IiauwVg9oI2LHtSVrp1NIjUycw==" + }, + "@capacitor/app": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@capacitor/app/-/app-1.0.5.tgz", + "integrity": "sha512-U0dAw1CAjKyguSRxKDabszsQ4dj679RnxaUZrSHDR5Jnt5x308oQuKXFP++wnMBbw72D02iqjG0a+/Ujye7C9g==" + }, + "@capacitor/cli": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@capacitor/cli/-/cli-3.3.0.tgz", + "integrity": "sha512-BkxagJhHG11+0ivFwUOnAhhdwQ1WXoX0WEzqzzGVL9k63hStuIOvPUusp34+G4EcNU01BAJlBt+dgefSvDhOFw==", + "dev": true, + "requires": { + "@ionic/cli-framework-output": "^2.2.1", + "@ionic/utils-fs": "^3.1.5", + "@ionic/utils-subprocess": "^2.1.6", + "@ionic/utils-terminal": "^2.3.0", + "commander": "^6.0.0", + "debug": "^4.2.0", + "env-paths": "^2.2.0", + "kleur": "^4.1.1", + "native-run": "^1.5.0", + "open": "^7.4.2", + "plist": "^3.0.2", + "prompts": "^2.3.2", + "semver": "^7.3.2", + "tar": "^6.1.11", + "tslib": "^2.1.0", + "xml2js": "^0.4.23" + }, + "dependencies": { + "@ionic/utils-object": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@ionic/utils-object/-/utils-object-2.1.5.tgz", + "integrity": "sha512-XnYNSwfewUqxq+yjER1hxTKggftpNjFLJH0s37jcrNDwbzmbpFTQTVAp4ikNK4rd9DOebX/jbeZb8jfD86IYxw==", + "dev": true, + "requires": { + "debug": "^4.0.0", + "tslib": "^2.0.1" + } + }, + "@ionic/utils-process": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@ionic/utils-process/-/utils-process-2.1.8.tgz", + "integrity": "sha512-VBBoyTzi+m6tgKAItl+jiTQneGwTOsctcrTG4CsEgmVOVOEhUYkPhddXqzD+oC54hPDU9ROsd3I014P5CWEuhQ==", + "dev": true, + "requires": { + "@ionic/utils-object": "2.1.5", + "@ionic/utils-terminal": "2.3.1", + "debug": "^4.0.0", + "signal-exit": "^3.0.3", + "tree-kill": "^1.2.2", + "tslib": "^2.0.1" + } + }, + "@ionic/utils-stream": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@ionic/utils-stream/-/utils-stream-3.1.5.tgz", + "integrity": "sha512-hkm46uHvEC05X/8PHgdJi4l4zv9VQDELZTM+Kz69odtO9zZYfnt8DkfXHJqJ+PxmtiE5mk/ehJWLnn/XAczTUw==", + "dev": true, + "requires": { + "debug": "^4.0.0", + "tslib": "^2.0.1" + } + }, + "@ionic/utils-subprocess": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@ionic/utils-subprocess/-/utils-subprocess-2.1.8.tgz", + "integrity": "sha512-pkmtf1LtXcEMPn6/cctREL2aZtZoy0+0Sl+nT0NIkOHIoBUcqrcfMWdctCSM4Mp6+2/hLWtgpHE3TOIibkWfIg==", + "dev": true, + "requires": { + "@ionic/utils-array": "2.1.5", + "@ionic/utils-fs": "3.1.5", + "@ionic/utils-process": "2.1.8", + "@ionic/utils-stream": "3.1.5", + "@ionic/utils-terminal": "2.3.1", + "cross-spawn": "^7.0.0", + "debug": "^4.0.0", + "tslib": "^2.0.1" + } + }, + "@ionic/utils-terminal": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@ionic/utils-terminal/-/utils-terminal-2.3.1.tgz", + "integrity": "sha512-cglsSd2AckI3Ldtdfczeq64vIIDjtPspV5QJtky8f8uIdxkeOIGeRV7bCj1+BEf1hyo+ZuggQxLviHnbMZhiRw==", + "dev": true, + "requires": { + "debug": "^4.0.0", + "signal-exit": "^3.0.3", + "slice-ansi": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "tslib": "^2.0.1", + "untildify": "^4.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "commander": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "dev": true + }, + "kleur": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.4.tgz", + "integrity": "sha512-8QADVssbrFjivHWQU7KkMgptGTl6WAcSdlbBPY4uNF+mWr6DGcKrvY2w4FQJoXch7+fKMjj0dRrL75vk3k23OA==", + "dev": true + } + } + }, + "@capacitor/core": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@capacitor/core/-/core-3.3.0.tgz", + "integrity": "sha512-bKkg/IGALz5OKJPGwtGXoqi4JUXWbuILnZ9J12Mv21fPMFBoszYOiMfm7FqdcCwqcyJWCdG3SQDxCz0Q3e2y8Q==", + "requires": { + "tslib": "^2.1.0" + } + }, + "@capacitor/haptics": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@capacitor/haptics/-/haptics-1.1.2.tgz", + "integrity": "sha512-h7uAK/iTSDYfvMY2aaZJ5tlGyIOOdH17mzHHED4jgP3TSXbsmeYU839u56hNGi9vb4Q00Jsb0YzsDMzSjv4Nag==" + }, + "@capacitor/keyboard": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@capacitor/keyboard/-/keyboard-1.1.2.tgz", + "integrity": "sha512-EUduhQzrHma4PlGfdSxVeGIwxR2+/xLRDbjQH5Q4cXqrlYssIX2UyQrL4wNpDaAOg1Z4VD8EzzVolC81LG6Q+A==" + }, + "@capacitor/status-bar": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@capacitor/status-bar/-/status-bar-1.0.5.tgz", + "integrity": "sha512-SZuxjaN5Nr8FKUVlkVH3l0X2JWey0yVMfMhyE3RG7ryUSAesgs3bvkAEXSfjphsHOpt4A/rEeCJb2ZbeCBwroA==" + }, "@cnakazawa/watch": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz", @@ -2235,21 +2372,6 @@ "resolved": "https://registry.npmjs.org/@ionic-native/fingerprint-aio/-/fingerprint-aio-4.20.0.tgz", "integrity": "sha512-DhdXVG7gdBtCwYHDAsNazIcMlyt6X968ilA/5Rt8uFd+xN4Un5gZteOJCVn9xWDC/ZqhO/QAq2M0BIGyEhzW0g==" }, - "@ionic-native/firebase-x": { - "version": "5.36.0", - "resolved": "https://registry.npmjs.org/@ionic-native/firebase-x/-/firebase-x-5.36.0.tgz", - "integrity": "sha512-h6jfTFqvABwugir5tsAzyvUWdu0EZg1PnWW0EkQy3CRg/qQlcjiDJW8pqyq1l84UDJQ7fxiTvbmX0Jod2BFE3w==", - "requires": { - "@types/cordova": "^0.0.34" - }, - "dependencies": { - "@types/cordova": { - "version": "0.0.34", - "resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz", - "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ=" - } - } - }, "@ionic-native/http": { "version": "5.36.0", "resolved": "https://registry.npmjs.org/@ionic-native/http/-/http-5.36.0.tgz", @@ -2587,6 +2709,35 @@ } } }, + "@ionic/cli-framework-output": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@ionic/cli-framework-output/-/cli-framework-output-2.2.2.tgz", + "integrity": "sha512-eQYkqIW1/tCwSC6Bd0gjse96U11lDX/ikf3jvsjX7a8z/zwSmGzCHRizb7xogV65Ey+1/zyAZR71cpDRQuFLBQ==", + "dev": true, + "requires": { + "@ionic/utils-terminal": "2.3.1", + "debug": "^4.0.0", + "tslib": "^2.0.1" + }, + "dependencies": { + "@ionic/utils-terminal": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@ionic/utils-terminal/-/utils-terminal-2.3.1.tgz", + "integrity": "sha512-cglsSd2AckI3Ldtdfczeq64vIIDjtPspV5QJtky8f8uIdxkeOIGeRV7bCj1+BEf1hyo+ZuggQxLviHnbMZhiRw==", + "dev": true, + "requires": { + "debug": "^4.0.0", + "signal-exit": "^3.0.3", + "slice-ansi": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "tslib": "^2.0.1", + "untildify": "^4.0.0", + "wrap-ansi": "^7.0.0" + } + } + } + }, "@ionic/core": { "version": "5.8.1", "resolved": "https://registry.npmjs.org/@ionic/core/-/core-5.8.1.tgz", @@ -5303,15 +5454,6 @@ } } }, - "bplist-creator": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.1.0.tgz", - "integrity": "sha512-sXaHZicyEEmY86WyueLTQesbeoH/mquvarJaQNbjuOQO+7gbFcDEWqKmcWA4cOTLzFlfgvkiVxolk1k5bBIpmg==", - "dev": true, - "requires": { - "stream-buffers": "2.2.x" - } - }, "bplist-parser": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz", @@ -7003,23 +7145,6 @@ "integrity": "sha512-FUHI6eEVeoz2VkxbF0P56QlUQLGzXcvw3i4xuXyM9gEct6Y+FA3Xzgl2pJTZcTg5wRqLWzN08kgNoHPkom15pw==", "dev": true }, - "cordova-plugin-fcm-with-dependecy-updated": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/cordova-plugin-fcm-with-dependecy-updated/-/cordova-plugin-fcm-with-dependecy-updated-7.2.0.tgz", - "integrity": "sha512-Iv1gOeoQ4l/1ztBLemgLOCS4iaVemHezfpa5/X+iqS4apfvUVLJ47Vw6KO7deBO2d2ElvrGZ2ayZX7j3uhtsRw==", - "dev": true, - "requires": { - "typescript": "^3.9.6" - }, - "dependencies": { - "typescript": { - "version": "3.9.10", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", - "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", - "dev": true - } - } - }, "cordova-plugin-file": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/cordova-plugin-file/-/cordova-plugin-file-6.0.2.tgz", @@ -7037,18 +7162,6 @@ "integrity": "sha512-Mmm/Ee85s4JH7qL3yikQ2J2I2vY2XbNi1fttoEK2kI++YHr/WeqPHWGREFL7bmFYjZTph/JovhfWHPGV924WjQ==", "dev": true }, - "cordova-plugin-firebasex": { - "version": "13.0.1", - "resolved": "https://registry.npmjs.org/cordova-plugin-firebasex/-/cordova-plugin-firebasex-13.0.1.tgz", - "integrity": "sha512-p9V8tJzT5ouRKhfz9Vo6uEdv0BvMJldXBrrw61H/0smT5JzJFcHu/BekhbIsF5yrpBSIwdSK15JA04JA4EtL3w==", - "dev": true, - "requires": { - "plist": "^3.0.1", - "semver": "^7.3.2", - "xcode": "^3.0.1", - "xml-js": "^1.6.11" - } - }, "cordova-plugin-globalization": { "version": "1.11.0", "resolved": "https://registry.npmjs.org/cordova-plugin-globalization/-/cordova-plugin-globalization-1.11.0.tgz", @@ -7085,1512 +7198,6 @@ "integrity": "sha512-pVQOrNM7VAuVUMXibAlMGIArrftHPrRs4dUCoE+e2HEFUp3LmN3Yj539LjdUxcWmz/A/cHC65m9E3DS56YJhcg==", "dev": true }, - "cordova-plugin-mfp": { - "version": "8.0.2021090603", - "resolved": "https://registry.npmjs.org/cordova-plugin-mfp/-/cordova-plugin-mfp-8.0.2021090603.tgz", - "integrity": "sha512-nphUrrMX6mLk8ofDLsSo6hTb6d5zLE6ik+QuWEXAsY57NwudyVgNwuR0byqkuVtqur3PfzLxQ81hZb481Kdjtw==", - "dev": true, - "requires": { - "archiver": "4.0.2", - "cordova-serve": "^1.0.0", - "crc": "^3.4.0", - "elementtree": "0.1.6", - "express": "^4.14.0", - "ibm-strings": "~0.1.0", - "jssha": "2.2.0", - "mfp-config-xml": "0.0.5", - "nopt": "^3.0.6", - "npmlog": "0.0.6", - "plist": "1.1.0", - "promiz": "1.0.5", - "q": "0.9.7", - "request": "^2.73.0", - "rimraf": "2.4.4", - "shelljs": "0.3.0", - "sjcl": "1.0.3", - "xcode": "0.8.7" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true - }, - "accepts": { - "version": "1.3.7", - "bundled": true, - "dev": true, - "requires": { - "mime-types": "~2.1.24", - "negotiator": "0.6.2" - } - }, - "ajv": { - "version": "6.12.6", - "bundled": true, - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi": { - "version": "0.3.1", - "bundled": true, - "dev": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "ansi-styles": { - "version": "2.2.1", - "bundled": true, - "dev": true - }, - "archiver": { - "version": "4.0.2", - "bundled": true, - "dev": true, - "requires": { - "archiver-utils": "^2.1.0", - "async": "^3.2.0", - "buffer-crc32": "^0.2.1", - "glob": "^7.1.6", - "readable-stream": "^3.6.0", - "tar-stream": "^2.1.2", - "zip-stream": "^3.0.1" - } - }, - "archiver-utils": { - "version": "2.1.0", - "bundled": true, - "dev": true, - "requires": { - "glob": "^7.1.4", - "graceful-fs": "^4.2.0", - "lazystream": "^1.0.0", - "lodash.defaults": "^4.2.0", - "lodash.difference": "^4.5.0", - "lodash.flatten": "^4.4.0", - "lodash.isplainobject": "^4.0.6", - "lodash.union": "^4.6.0", - "normalize-path": "^3.0.0", - "readable-stream": "^2.0.0" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "bundled": true, - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - } - } - }, - "are-we-there-yet": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.0 || ^1.1.13" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "bundled": true, - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - } - } - }, - "array-flatten": { - "version": "1.1.1", - "bundled": true, - "dev": true - }, - "asn1": { - "version": "0.2.4", - "bundled": true, - "dev": true, - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "async": { - "version": "3.2.1", - "bundled": true, - "dev": true - }, - "asynckit": { - "version": "0.4.0", - "bundled": true, - "dev": true - }, - "aws-sign2": { - "version": "0.7.0", - "bundled": true, - "dev": true - }, - "aws4": { - "version": "1.11.0", - "bundled": true, - "dev": true - }, - "balanced-match": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "base64-js": { - "version": "1.5.1", - "bundled": true, - "dev": true - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "bl": { - "version": "4.1.0", - "bundled": true, - "dev": true, - "requires": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "body-parser": { - "version": "1.19.0", - "bundled": true, - "dev": true, - "requires": { - "bytes": "3.1.0", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "~1.1.2", - "http-errors": "1.7.2", - "iconv-lite": "0.4.24", - "on-finished": "~2.3.0", - "qs": "6.7.0", - "raw-body": "2.4.0", - "type-is": "~1.6.17" - }, - "dependencies": { - "bytes": { - "version": "3.1.0", - "bundled": true, - "dev": true - } - } - }, - "bplist-creator": { - "version": "0.0.4", - "bundled": true, - "dev": true, - "requires": { - "stream-buffers": "~0.2.3" - } - }, - "bplist-parser": { - "version": "0.0.6", - "bundled": true, - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "buffer": { - "version": "5.7.1", - "bundled": true, - "dev": true, - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "buffer-crc32": { - "version": "0.2.13", - "bundled": true, - "dev": true - }, - "bytes": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "caseless": { - "version": "0.12.0", - "bundled": true, - "dev": true - }, - "chalk": { - "version": "1.1.3", - "bundled": true, - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "colors": { - "version": "1.1.2", - "bundled": true, - "dev": true - }, - "combined-stream": { - "version": "1.0.8", - "bundled": true, - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "compress-commons": { - "version": "3.0.0", - "bundled": true, - "dev": true, - "requires": { - "buffer-crc32": "^0.2.13", - "crc32-stream": "^3.0.1", - "normalize-path": "^3.0.0", - "readable-stream": "^2.3.7" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "bundled": true, - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - } - } - }, - "compressible": { - "version": "2.0.18", - "bundled": true, - "dev": true, - "requires": { - "mime-db": ">= 1.43.0 < 2" - } - }, - "compression": { - "version": "1.7.4", - "bundled": true, - "dev": true, - "requires": { - "accepts": "~1.3.5", - "bytes": "3.0.0", - "compressible": "~2.0.16", - "debug": "2.6.9", - "on-headers": "~1.0.2", - "safe-buffer": "5.1.2", - "vary": "~1.1.2" - } - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "content-disposition": { - "version": "0.5.3", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "5.1.2" - } - }, - "content-type": { - "version": "1.0.4", - "bundled": true, - "dev": true - }, - "cookie": { - "version": "0.4.0", - "bundled": true, - "dev": true - }, - "cookie-signature": { - "version": "1.0.6", - "bundled": true, - "dev": true - }, - "cordova-serve": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "requires": { - "chalk": "^1.1.1", - "compression": "^1.6.0", - "express": "^4.13.3", - "q": "^1.4.1" - }, - "dependencies": { - "q": { - "version": "1.5.1", - "bundled": true, - "dev": true - } - } - }, - "core-util-is": { - "version": "1.0.3", - "bundled": true, - "dev": true - }, - "crc": { - "version": "3.8.0", - "bundled": true, - "dev": true, - "requires": { - "buffer": "^5.1.0" - } - }, - "crc32-stream": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "crc": "^3.4.4", - "readable-stream": "^3.4.0" - } - }, - "dashdash": { - "version": "1.14.1", - "bundled": true, - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "debug": { - "version": "2.6.9", - "bundled": true, - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "delayed-stream": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "depd": { - "version": "1.1.2", - "bundled": true, - "dev": true - }, - "destroy": { - "version": "1.0.4", - "bundled": true, - "dev": true - }, - "ecc-jsbn": { - "version": "0.1.2", - "bundled": true, - "dev": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "ee-first": { - "version": "1.1.1", - "bundled": true, - "dev": true - }, - "elementtree": { - "version": "0.1.6", - "bundled": true, - "dev": true, - "requires": { - "sax": "0.3.5" - } - }, - "encodeurl": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "end-of-stream": { - "version": "1.4.4", - "bundled": true, - "dev": true, - "requires": { - "once": "^1.4.0" - } - }, - "escape-html": { - "version": "1.0.3", - "bundled": true, - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "bundled": true, - "dev": true - }, - "etag": { - "version": "1.8.1", - "bundled": true, - "dev": true - }, - "express": { - "version": "4.17.1", - "bundled": true, - "dev": true, - "requires": { - "accepts": "~1.3.7", - "array-flatten": "1.1.1", - "body-parser": "1.19.0", - "content-disposition": "0.5.3", - "content-type": "~1.0.4", - "cookie": "0.4.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "~1.1.2", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "~1.1.2", - "fresh": "0.5.2", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.5", - "qs": "6.7.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.1.2", - "send": "0.17.1", - "serve-static": "1.14.1", - "setprototypeof": "1.1.1", - "statuses": "~1.5.0", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - } - }, - "extend": { - "version": "3.0.2", - "bundled": true, - "dev": true - }, - "extsprintf": { - "version": "1.2.0", - "bundled": true, - "dev": true - }, - "fast-deep-equal": { - "version": "3.1.3", - "bundled": true, - "dev": true - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "bundled": true, - "dev": true - }, - "finalhandler": { - "version": "1.1.2", - "bundled": true, - "dev": true, - "requires": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "statuses": "~1.5.0", - "unpipe": "~1.0.0" - } - }, - "findup-sync": { - "version": "0.3.0", - "bundled": true, - "dev": true, - "requires": { - "glob": "~5.0.0" - }, - "dependencies": { - "glob": { - "version": "5.0.15", - "bundled": true, - "dev": true, - "requires": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } - } - }, - "forever-agent": { - "version": "0.6.1", - "bundled": true, - "dev": true - }, - "form-data": { - "version": "2.3.3", - "bundled": true, - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "forwarded": { - "version": "0.2.0", - "bundled": true, - "dev": true - }, - "fresh": { - "version": "0.5.2", - "bundled": true, - "dev": true - }, - "fs-constants": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "gauge": { - "version": "1.2.7", - "bundled": true, - "dev": true, - "requires": { - "ansi": "^0.3.0", - "has-unicode": "^2.0.0", - "lodash.pad": "^4.1.0", - "lodash.padend": "^4.1.0", - "lodash.padstart": "^4.1.0" - } - }, - "getpass": { - "version": "0.1.7", - "bundled": true, - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - } - }, - "glob": { - "version": "7.1.7", - "bundled": true, - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "graceful-fs": { - "version": "4.2.8", - "bundled": true, - "dev": true - }, - "har-schema": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "har-validator": { - "version": "5.1.5", - "bundled": true, - "dev": true, - "requires": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - } - }, - "has-ansi": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true - }, - "http-errors": { - "version": "1.7.2", - "bundled": true, - "dev": true, - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.1", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.0" - }, - "dependencies": { - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - } - } - }, - "http-signature": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "ibm-strings": { - "version": "0.1.4", - "bundled": true, - "dev": true, - "requires": { - "colors": "1.1.2", - "nopt": "3.0.6" - } - }, - "iconv-lite": { - "version": "0.4.24", - "bundled": true, - "dev": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ieee754": { - "version": "1.2.1", - "bundled": true, - "dev": true - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "bundled": true, - "dev": true - }, - "ipaddr.js": { - "version": "1.9.1", - "bundled": true, - "dev": true - }, - "is-typedarray": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "isstream": { - "version": "0.1.2", - "bundled": true, - "dev": true - }, - "jsbn": { - "version": "0.1.1", - "bundled": true, - "dev": true - }, - "json-schema": { - "version": "0.2.3", - "bundled": true, - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "bundled": true, - "dev": true - }, - "json-stringify-safe": { - "version": "5.0.1", - "bundled": true, - "dev": true - }, - "jsprim": { - "version": "1.4.1", - "bundled": true, - "dev": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" - }, - "dependencies": { - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "extsprintf": { - "version": "1.3.0", - "bundled": true, - "dev": true - }, - "verror": { - "version": "1.10.0", - "bundled": true, - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - } - } - }, - "jssha": { - "version": "2.2.0", - "bundled": true, - "dev": true - }, - "lazystream": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "readable-stream": "^2.0.5" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "bundled": true, - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - } - } - }, - "lodash-node": { - "version": "2.4.1", - "bundled": true, - "dev": true - }, - "lodash.defaults": { - "version": "4.2.0", - "bundled": true, - "dev": true - }, - "lodash.difference": { - "version": "4.5.0", - "bundled": true, - "dev": true - }, - "lodash.flatten": { - "version": "4.4.0", - "bundled": true, - "dev": true - }, - "lodash.isplainobject": { - "version": "4.0.6", - "bundled": true, - "dev": true - }, - "lodash.pad": { - "version": "4.5.1", - "bundled": true, - "dev": true - }, - "lodash.padend": { - "version": "4.6.1", - "bundled": true, - "dev": true - }, - "lodash.padstart": { - "version": "4.6.1", - "bundled": true, - "dev": true - }, - "lodash.union": { - "version": "4.6.0", - "bundled": true, - "dev": true - }, - "media-typer": { - "version": "0.3.0", - "bundled": true, - "dev": true - }, - "merge-descriptors": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "methods": { - "version": "1.1.2", - "bundled": true, - "dev": true - }, - "mfp-config-xml": { - "version": "0.0.5", - "bundled": true, - "dev": true, - "requires": { - "elementtree": "0.1.6", - "findup-sync": "0.3.0", - "glob": "7.0.3", - "ibm-strings": "0.1.4", - "npmlog": "2.0.2", - "q": "1.4.1", - "underscore": "1.8.3", - "verror": "1.6.1" - }, - "dependencies": { - "glob": { - "version": "7.0.3", - "bundled": true, - "dev": true, - "requires": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "npmlog": { - "version": "2.0.2", - "bundled": true, - "dev": true, - "requires": { - "ansi": "~0.3.1", - "are-we-there-yet": "~1.0.6", - "gauge": "~1.2.5" - } - }, - "q": { - "version": "1.4.1", - "bundled": true, - "dev": true - } - } - }, - "mime": { - "version": "1.6.0", - "bundled": true, - "dev": true - }, - "mime-db": { - "version": "1.49.0", - "bundled": true, - "dev": true - }, - "mime-types": { - "version": "2.1.32", - "bundled": true, - "dev": true, - "requires": { - "mime-db": "1.49.0" - } - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "negotiator": { - "version": "0.6.2", - "bundled": true, - "dev": true - }, - "nopt": { - "version": "3.0.6", - "bundled": true, - "dev": true, - "requires": { - "abbrev": "1" - } - }, - "normalize-path": { - "version": "3.0.0", - "bundled": true, - "dev": true - }, - "npmlog": { - "version": "0.0.6", - "bundled": true, - "dev": true, - "requires": { - "ansi": "~0.2.1" - }, - "dependencies": { - "ansi": { - "version": "0.2.1", - "bundled": true, - "dev": true - } - } - }, - "oauth-sign": { - "version": "0.9.0", - "bundled": true, - "dev": true - }, - "on-finished": { - "version": "2.3.0", - "bundled": true, - "dev": true, - "requires": { - "ee-first": "1.1.1" - } - }, - "on-headers": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "parseurl": { - "version": "1.3.3", - "bundled": true, - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "path-to-regexp": { - "version": "0.1.7", - "bundled": true, - "dev": true - }, - "pegjs": { - "version": "0.6.2", - "bundled": true, - "dev": true - }, - "performance-now": { - "version": "2.1.0", - "bundled": true, - "dev": true - }, - "plist": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "requires": { - "base64-js": "0.0.6", - "util-deprecate": "1.0.0", - "xmlbuilder": "2.2.1", - "xmldom": "0.1.x" - }, - "dependencies": { - "base64-js": { - "version": "0.0.6", - "bundled": true, - "dev": true - }, - "util-deprecate": { - "version": "1.0.0", - "bundled": true, - "dev": true - } - } - }, - "process-nextick-args": { - "version": "2.0.1", - "bundled": true, - "dev": true - }, - "promiz": { - "version": "1.0.5", - "bundled": true, - "dev": true - }, - "proxy-addr": { - "version": "2.0.7", - "bundled": true, - "dev": true, - "requires": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - } - }, - "psl": { - "version": "1.8.0", - "bundled": true, - "dev": true - }, - "punycode": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "q": { - "version": "0.9.7", - "bundled": true, - "dev": true - }, - "qs": { - "version": "6.7.0", - "bundled": true, - "dev": true - }, - "range-parser": { - "version": "1.2.1", - "bundled": true, - "dev": true - }, - "raw-body": { - "version": "2.4.0", - "bundled": true, - "dev": true, - "requires": { - "bytes": "3.1.0", - "http-errors": "1.7.2", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "dependencies": { - "bytes": { - "version": "3.1.0", - "bundled": true, - "dev": true - } - } - }, - "readable-stream": { - "version": "3.6.0", - "bundled": true, - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "request": { - "version": "2.88.2", - "bundled": true, - "dev": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "dependencies": { - "qs": { - "version": "6.5.2", - "bundled": true, - "dev": true - } - } - }, - "rimraf": { - "version": "2.4.4", - "bundled": true, - "dev": true, - "requires": { - "glob": "^5.0.14" - }, - "dependencies": { - "glob": { - "version": "5.0.15", - "bundled": true, - "dev": true, - "requires": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true, - "dev": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "dev": true - }, - "sax": { - "version": "0.3.5", - "bundled": true, - "dev": true - }, - "send": { - "version": "0.17.1", - "bundled": true, - "dev": true, - "requires": { - "debug": "2.6.9", - "depd": "~1.1.2", - "destroy": "~1.0.4", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "~1.7.2", - "mime": "1.6.0", - "ms": "2.1.1", - "on-finished": "~2.3.0", - "range-parser": "~1.2.1", - "statuses": "~1.5.0" - }, - "dependencies": { - "ms": { - "version": "2.1.1", - "bundled": true, - "dev": true - } - } - }, - "serve-static": { - "version": "1.14.1", - "bundled": true, - "dev": true, - "requires": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.17.1" - } - }, - "setprototypeof": { - "version": "1.1.1", - "bundled": true, - "dev": true - }, - "shelljs": { - "version": "0.3.0", - "bundled": true, - "dev": true - }, - "simple-plist": { - "version": "0.0.4", - "bundled": true, - "dev": true, - "requires": { - "bplist-creator": "0.0.4", - "bplist-parser": "0.0.6", - "plist": "1.1.0" - } - }, - "sjcl": { - "version": "1.0.3", - "bundled": true, - "dev": true - }, - "sshpk": { - "version": "1.16.1", - "bundled": true, - "dev": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "statuses": { - "version": "1.5.0", - "bundled": true, - "dev": true - }, - "stream-buffers": { - "version": "0.2.6", - "bundled": true, - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "bundled": true, - "dev": true - }, - "tar-stream": { - "version": "2.2.0", - "bundled": true, - "dev": true, - "requires": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - } - }, - "toidentifier": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "tough-cookie": { - "version": "2.5.0", - "bundled": true, - "dev": true, - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" - } - }, - "tunnel-agent": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "bundled": true, - "dev": true - }, - "type-is": { - "version": "1.6.18", - "bundled": true, - "dev": true, - "requires": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - } - }, - "underscore": { - "version": "1.8.3", - "bundled": true, - "dev": true - }, - "unpipe": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "uri-js": { - "version": "4.4.1", - "bundled": true, - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "utils-merge": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "uuid": { - "version": "3.4.0", - "bundled": true, - "dev": true - }, - "vary": { - "version": "1.1.2", - "bundled": true, - "dev": true - }, - "verror": { - "version": "1.6.1", - "bundled": true, - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "extsprintf": "1.2.0" - }, - "dependencies": { - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true - } - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "xcode": { - "version": "0.8.7", - "bundled": true, - "dev": true, - "requires": { - "node-uuid": "1.4.7", - "pegjs": "0.6.2", - "simple-plist": "0.0.4" - }, - "dependencies": { - "node-uuid": { - "version": "1.4.7", - "bundled": true, - "dev": true - } - } - }, - "xmlbuilder": { - "version": "2.2.1", - "bundled": true, - "dev": true, - "requires": { - "lodash-node": "~2.4.1" - } - }, - "xmldom": { - "version": "0.1.31", - "bundled": true, - "dev": true - }, - "zip-stream": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "archiver-utils": "^2.1.0", - "compress-commons": "^3.0.0", - "readable-stream": "^3.6.0" - } - } - } - }, "cordova-plugin-network-information": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cordova-plugin-network-information/-/cordova-plugin-network-information-3.0.0.tgz", @@ -16744,6 +15351,61 @@ "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==" }, + "native-run": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/native-run/-/native-run-1.5.0.tgz", + "integrity": "sha512-YYsYYAljk70N+FJLeY5KuafsBit7agOBR3ch1KTXOaKkREkM49yCwJIwVz2faoWpJ2MeyLdXltk5PskUuPQqZA==", + "dev": true, + "requires": { + "@ionic/utils-fs": "^3.1.5", + "@ionic/utils-terminal": "^2.3.1", + "bplist-parser": "^0.3.0", + "debug": "^4.3.2", + "elementtree": "^0.1.7", + "ini": "^1.3.5", + "plist": "^3.0.4", + "split2": "^3.2.2", + "through2": "^4.0.2", + "tslib": "^2.3.1", + "yauzl": "^2.10.0" + }, + "dependencies": { + "@ionic/utils-terminal": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@ionic/utils-terminal/-/utils-terminal-2.3.1.tgz", + "integrity": "sha512-cglsSd2AckI3Ldtdfczeq64vIIDjtPspV5QJtky8f8uIdxkeOIGeRV7bCj1+BEf1hyo+ZuggQxLviHnbMZhiRw==", + "dev": true, + "requires": { + "debug": "^4.0.0", + "signal-exit": "^3.0.3", + "slice-ansi": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "tslib": "^2.0.1", + "untildify": "^4.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "bplist-parser": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.0.tgz", + "integrity": "sha512-zgmaRvT6AN1JpPPV+S0a1/FAtoxSreYDccZGIqEMSvZl9DMe70mJ7MFzpxa1X+gHVdkToE2haRUHHMiW1OdejA==", + "dev": true, + "requires": { + "big-integer": "1.6.x" + } + }, + "through2": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", + "dev": true, + "requires": { + "readable-stream": "3" + } + } + } + }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -21102,28 +19764,6 @@ } } }, - "simple-plist": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/simple-plist/-/simple-plist-1.3.0.tgz", - "integrity": "sha512-uYWpeGFtZtVt2NhG4AHgpwx323zxD85x42heMJBan1qAiqqozIlaGrwrEt6kRjXWRWIXsuV1VLCvVmZan2B5dg==", - "dev": true, - "requires": { - "bplist-creator": "0.1.0", - "bplist-parser": "0.3.0", - "plist": "^3.0.4" - }, - "dependencies": { - "bplist-parser": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.0.tgz", - "integrity": "sha512-zgmaRvT6AN1JpPPV+S0a1/FAtoxSreYDccZGIqEMSvZl9DMe70mJ7MFzpxa1X+gHVdkToE2haRUHHMiW1OdejA==", - "dev": true, - "requires": { - "big-integer": "1.6.x" - } - } - } - }, "simple-swizzle": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", @@ -21613,6 +20253,15 @@ "extend-shallow": "^3.0.0" } }, + "split2": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", + "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", + "dev": true, + "requires": { + "readable-stream": "^3.0.0" + } + }, "sprintf-js": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", @@ -21695,12 +20344,6 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" }, - "stream-buffers": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/stream-buffers/-/stream-buffers-2.2.0.tgz", - "integrity": "sha1-kdX1Ew0c75bc+n9yaUUYh0HQnuQ=", - "dev": true - }, "stream-throttle": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/stream-throttle/-/stream-throttle-0.1.3.tgz", @@ -25108,46 +23751,11 @@ "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz", "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==" }, - "xcode": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/xcode/-/xcode-3.0.1.tgz", - "integrity": "sha512-kCz5k7J7XbJtjABOvkc5lJmkiDh8VhjVCGNiqdKCscmVpdVUpEAyXv1xmCLkQJ5dsHqx3IPO4XW+NTDhU/fatA==", - "dev": true, - "requires": { - "simple-plist": "^1.1.0", - "uuid": "^7.0.3" - }, - "dependencies": { - "uuid": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz", - "integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==", - "dev": true - } - } - }, "xdg-basedir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==" }, - "xml-js": { - "version": "1.6.11", - "resolved": "https://registry.npmjs.org/xml-js/-/xml-js-1.6.11.tgz", - "integrity": "sha512-7rVi2KMfwfWFl+GpPg6m80IVMWXLRjO+PxTq7V2CDhoGak0wzYzFgUY2m4XJ47OGdXd8eLE8EmwfAmdjw7lC1g==", - "dev": true, - "requires": { - "sax": "^1.2.4" - }, - "dependencies": { - "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", - "dev": true - } - } - }, "xml-name-validator": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", diff --git a/package.json b/package.json index 1fcb3461e..67bc368d0 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,12 @@ "@angular/platform-browser": "~12.1.2", "@angular/platform-browser-dynamic": "~12.1.2", "@angular/router": "~12.1.2", + "@capacitor/android": "^3.3.0", + "@capacitor/app": "^1.0.5", + "@capacitor/core": "^3.3.0", + "@capacitor/haptics": "^1.1.2", + "@capacitor/keyboard": "^1.1.2", + "@capacitor/status-bar": "^1.0.5", "@fortawesome/angular-fontawesome": "^0.9.0", "@fortawesome/fontawesome-free": "^5.15.3", "@fortawesome/fontawesome-svg-core": "^1.2.35", @@ -46,7 +52,6 @@ "@ionic-native/file": "^5.36.0", "@ionic-native/file-path": "^5.30.0", "@ionic-native/fingerprint-aio": "^4.20.0", - "@ionic-native/firebase-x": "^5.36.0", "@ionic-native/http": "^5.31.1", "@ionic-native/image-picker": "^5.36.0", "@ionic-native/in-app-browser": "^5.28.0", @@ -103,7 +108,7 @@ "ionic2-calendar": "^0.6.6", "ionicons": "^5.5.3", "jest-puppeteer": "^5.0.4", - "jetifier": "^1.6.6", + "jetifier": "^1.6.8", "lite-server": "^2.6.1", "moment": "^2.29.1", "ng2-pdf-viewer": "^7.0.1", @@ -129,6 +134,7 @@ "@angular/compiler": "^12.1.2", "@angular/compiler-cli": "^12.1.2", "@angular/language-service": "^12.1.2", + "@capacitor/cli": "^3.3.0", "@ionic/angular-toolkit": "^4.0.0", "@ionic/lab": "3.1.7", "@types/jasmine": "~3.6.0", @@ -145,17 +151,14 @@ "cordova-plugin-compat": "^1.2.0", "cordova-plugin-device": "^2.0.2", "cordova-plugin-dialogs": "^2.0.2", - "cordova-plugin-fcm-with-dependecy-updated": "^7.2.0", "cordova-plugin-file": "^6.0.2", "cordova-plugin-fingerprint-aio": "^4.0.2", - "cordova-plugin-firebasex": "^13.0.1", "cordova-plugin-globalization": "^1.11.0", "cordova-plugin-inappbrowser": "^4.0.0", "cordova-plugin-ionic-keyboard": "^2.2.0", "cordova-plugin-ionic-webview": "^5.0.0", "cordova-plugin-media": "^5.0.3", "cordova-plugin-media-capture": "^3.0.3", - "cordova-plugin-mfp": "^8.0.2021031007", "cordova-plugin-network-information": "^3.0.0", "cordova-plugin-screen-orientation": "^3.0.2", "cordova-plugin-splashscreen": "^5.0.2", @@ -240,4 +243,4 @@ "url": "git+https://Kayaya@bitbucket.org/equilibriumito/gabinete-digital.git" }, "license": "ISC" -} \ No newline at end of file +} diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 22ca48f4a..4a8f6e002 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -65,8 +65,8 @@ import { Media } from '@ionic-native/media/ngx'; import { StreamingMedia } from '@ionic-native/streaming-media/ngx'; import { PhotoViewer } from '@ionic-native/photo-viewer/ngx'; -import { FCM } from '@ionic-native/fcm/ngx'; -import { FirebaseX } from '@ionic-native/firebase-x/ngx'; +/* import { FCM } from '@ionic-native/fcm/ngx'; +import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */ //import { FCM } from 'cordova-plugin-fcm-with-dependecy-updated/ionic/ngx'; @NgModule({ @@ -115,8 +115,8 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; //File, WebView, FilePath, - FCM, - FirebaseX, + /* FCM, + FirebaseX, */ WebsocketService, ChatService, ScreenOrientation, diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts index f989804a9..66d63b16e 100644 --- a/src/app/home/home.page.ts +++ b/src/app/home/home.page.ts @@ -1,11 +1,9 @@ /* eslint-disable */ /* tslint:disable */ -/// -/* /// */ import { Component, OnInit, NgZone } from '@angular/core'; import { Event } from '../models/event.model'; -import { NotificationsService } from '../services/notifications.service'; -import { WebNotificationsService } from '../services/webnotifications.service'; +/* import { NotificationsService } from '../services/notifications.service'; +import { WebNotificationsService } from '../services/webnotifications.service'; */ import { AlertController, Platform } from '@ionic/angular'; import { Router, ActivatedRoute } from '@angular/router'; import { ToDayEventStorage } from '../store/to-day-event-storage.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', @@ -74,10 +70,10 @@ export class HomePage implements OnInit { private zone: NgZone, private router: Router, public modalCtrl: AlertController, - private notificationsService: NotificationsService, + /* private notificationsService: NotificationsService, */ private platform: Platform, private activeroute: ActivatedRoute, - private webnotification: WebNotificationsService, + /* private webnotification: WebNotificationsService, */ public p: PermissionService, public documentCounterService: DocumentCounterService, private despachoRule: DespachoService, @@ -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() @@ -119,28 +114,14 @@ export class HomePage implements OnInit { ngOnInit() { - 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(); - //this.notificationsService.onReceviNotification(); + /* this.notificationsService.onReceviNotification(); */ this.offlinemanager.synchnize() } }); @@ -160,53 +141,14 @@ 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( + /* this.notificationsService.registerCallback( 'despachos', () => { this.despachoRule.getList({ updateStore: true }) } - ) + ) */ document.addEventListener('pause', function () { // console.log('App going to background'); diff --git a/src/app/modals/profile/profile.page.ts b/src/app/modals/profile/profile.page.ts index 57f7bffcb..79dc59d2c 100644 --- a/src/app/modals/profile/profile.page.ts +++ b/src/app/modals/profile/profile.page.ts @@ -1,5 +1,3 @@ -/// -/* /// */ import { Component, OnInit, NgZone } from '@angular/core'; import { Router, NavigationExtras } from '@angular/router'; import { AnimationController, ModalController,Platform } from '@ionic/angular'; @@ -7,9 +5,8 @@ import { LoginUserRespose } from 'src/app/models/user.model'; import { AuthService } from 'src/app/services/auth.service'; import { LocalstoreService } from 'src/app/store/localstore.service'; import { EditProfilePage } from './edit-profile/edit-profile.page'; -import { JsonStore } from '../../services/jsonStore.service'; import { StorageService } from '../../services/storage.service'; -import { NotificationsService } from '../../services/notifications.service'; +/* import { NotificationsService } from '../../services/notifications.service'; */ import { SessionStore } from 'src/app/store/session.service'; import { EventTrigger } from '../../services/eventTrigger.service'; import { ThemeService } from 'src/app/services/theme.service' @@ -39,12 +36,11 @@ export class ProfilePage implements OnInit { private animationController: AnimationController, private router: Router, private localstoreService: LocalstoreService, - private jsonstore: JsonStore, private storageservice: StorageService, private zone: NgZone, - private notificationservice: NotificationsService, + /* private notificationservice: NotificationsService, */ private platform: Platform, - private notificationsService: NotificationsService, + /* private notificationsService: NotificationsService, */ private eventtrigger: EventTrigger, public ThemeService: ThemeService ) { @@ -63,14 +59,14 @@ export class ProfilePage implements OnInit { this.getNotificationData(); } - this.notificationsService.registerCallback( + /* this.notificationsService.registerCallback( 'any', () => { setTimeout(()=>{ this.getNotificationData(); }, 100) } - ) + ) */ } @@ -98,22 +94,37 @@ export class ProfilePage implements OnInit { value.forEach((element,i) => { console.log("ARaaAA", element) let notificationObject; - if(element.payload){ + notificationObject = { + index: i, + //alert: element.alert, + Service: element.Service, + Object: element.Object, + IdObject: element.IdObject, + FolderId: 1, + //desc: payload.desc, + //dateInit: this.getFormatedTime(payload.dateInit), + //dateEnd: this.getFormatedTime(payload.dateEnd), + //Location: payload.Location, + //TypeAgenda: payload.TypeAgenda, + //Role: payload.Role, + //Status: payload.Status + } + /* if(element.payload){ var payload = JSON.parse(element.payload) notificationObject = { - index: i, - alert: element.alert, + //index: i, + //alert: element.alert, Service: payload.Service, Object: payload.Object, IdObject: payload.IdObject, - FolderId: payload.FolderId, - desc: payload.desc, - dateInit: this.getFormatedTime(payload.dateInit), - dateEnd: this.getFormatedTime(payload.dateEnd), - Location: payload.Location, - TypeAgenda: payload.TypeAgenda, - Role: payload.Role, - Status: payload.Status + //FolderId: payload.FolderId, + //desc: payload.desc, + //dateInit: this.getFormatedTime(payload.dateInit), + //dateEnd: this.getFormatedTime(payload.dateEnd), + //Location: payload.Location, + //TypeAgenda: payload.TypeAgenda, + //Role: payload.Role, + //Status: payload.Status } } else { notificationObject = { @@ -130,8 +141,8 @@ export class ProfilePage implements OnInit { TypeAgenda: element.TypeAgenda, Role: element.Role, Status: element.Status - } - } + } + }*/ this.DataArray.push(notificationObject) @@ -202,7 +213,7 @@ export class ProfilePage implements OnInit { this.zone.run(() => this.router.navigate(['/home/gabinete-digital/expedientes-pr', IdObject, 'gabinete-digital'])); } - this.notificationservice.tempClearArray(); + //this.notificationservice.tempClearArray(); this.deleteNotification(index); this.eventtrigger.publishSomeData({ notification: "deleted" diff --git a/src/app/pages/chat/chat.page.ts b/src/app/pages/chat/chat.page.ts index 2a6c69e75..ed4d3d35d 100644 --- a/src/app/pages/chat/chat.page.ts +++ b/src/app/pages/chat/chat.page.ts @@ -26,7 +26,7 @@ import { NavigationStart, NavigationEnd, Router } from '@angular/router'; import { EventPerson } from 'src/app/models/eventperson.model'; import { removeDuplicate } from 'src/plugin/removeDuplicate.js' import { environment } from 'src/environments/environment'; -import { NotificationsService } from 'src/app/services/notifications.service'; +//import { NotificationsService } from 'src/app/services/notifications.service'; import { TimeService } from 'src/app/services/functions/time.service'; import { ThemeService } from 'src/app/services/theme.service' diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.ts b/src/app/pages/gabinete-digital/gabinete-digital.page.ts index d74544854..9ae555f51 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.ts +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.ts @@ -19,7 +19,7 @@ import { WaitForDomService } from 'src/app/services/dom/wait-for-dom.service'; import { TotalDocumentStore } from 'src/app/store/total-document.service'; import { DeplomasStore } from 'src/app/store/deplomas.service'; import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe'; -import { NotificationsService } from 'src/app/services/notifications.service'; +//import { NotificationsService } from 'src/app/services/notifications.service'; import { DespachoService } from 'src/app/Rules/despacho.service'; import { ChangeProfileService } from 'src/app/services/change-profile.service'; import { PermissionService } from 'src/app/services/worker/permission.service'; @@ -124,7 +124,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck { authService: AuthService, public p: PermissionService, public waitForDomService: WaitForDomService, - private notificationsService: NotificationsService, + //private notificationsService: NotificationsService, private despachoRule: DespachoService, private sqliteservice: SqliteService, private platform: Platform, diff --git a/src/app/pages/inactivity/inactivity.page.ts b/src/app/pages/inactivity/inactivity.page.ts index 20b3a67c4..b813b6b8f 100644 --- a/src/app/pages/inactivity/inactivity.page.ts +++ b/src/app/pages/inactivity/inactivity.page.ts @@ -5,7 +5,7 @@ import { UserForm } from 'src/app/models/user.model'; import { ToastService } from 'src/app/services/toast.service'; import { environment } from 'src/environments/environment'; import { AlertController } from '@ionic/angular'; -import { NotificationsService } from 'src/app/services/notifications.service'; +//import { NotificationsService } from 'src/app/services/notifications.service'; import { SessionStore } from 'src/app/store/session.service'; @@ -25,7 +25,7 @@ export class InactivityPage implements OnInit { enterWithPassword = false constructor( - private notificatinsservice: NotificationsService, + //private notificatinsservice: NotificationsService, private router: Router, private authService: AuthService, private toastService: ToastService, diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index 411e03c07..89b416590 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -5,7 +5,7 @@ import { UserForm } from 'src/app/models/user.model'; import { ToastService } from 'src/app/services/toast.service'; import { environment } from 'src/environments/environment'; import { AlertController } from '@ionic/angular'; -import { NotificationsService } from 'src/app/services/notifications.service'; +//import { NotificationsService } from 'src/app/services/notifications.service'; import { SessionStore } from 'src/app/store/session.service'; import { ClearStoreService } from 'src/app/services/clear-store.service'; import { ChangeProfileService } from 'src/app/services/change-profile.service'; @@ -31,7 +31,7 @@ export class LoginPage implements OnInit { sessionStore = SessionStore constructor( - private notificatinsservice: NotificationsService, + //private notificatinsservice: NotificationsService, private router: Router, private authService: AuthService, private toastService: ToastService, @@ -74,7 +74,7 @@ export class LoginPage implements OnInit { } getToken() { - this.notificatinsservice.getAndpostToken(this.username); + //this.notificatinsservice.getAndpostToken(this.username); } async Login() { diff --git a/src/app/services/jsonStore.service.spec.ts b/src/app/services/jsonStore.service.spec.ts deleted file mode 100644 index ed030373c..000000000 --- a/src/app/services/jsonStore.service.spec.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { TestBed } from '@angular/core/testing'; - -import { JsonStore } from './jsonStore.service'; - -describe('JsonStore', () => { - let service: JsonStore; - - beforeEach(() => { - TestBed.configureTestingModule({}); - service = TestBed.inject(JsonStore); - }); - - it('should be created', () => { - expect(service).toBeTruthy(); - }); -}); diff --git a/src/app/services/jsonStore.service.ts b/src/app/services/jsonStore.service.ts deleted file mode 100644 index a87920299..000000000 --- a/src/app/services/jsonStore.service.ts +++ /dev/null @@ -1,130 +0,0 @@ -/// -/* /// */ -import { Injectable } from "@angular/core"; - -@Injectable({ - providedIn: 'root' -}) - -export class JsonStore { - -/* createCollection(name, data) { - - var collectionName = name; - var addOptions = { - // Mark data as dirty (true = yes, false = no), default true. - markDirty: true - }; - - var JSONStoreCollections = {}; - JSONStoreCollections[collectionName] = {}; - JSONStoreCollections[collectionName].searchFields = { UserId: 'integer' }; - - WL.JSONStore.init(JSONStoreCollections) - - .then(function () { - WL.Logger.debug('Init done'); - console.log('Init done'); - return WL.JSONStore.get(collectionName).add(data, addOptions); - - }).fail(function (err) { - WL.Logger.error(err); - console.log(err) - }); - - } - - getCollection(collectionName) { - - var allOptions = { - // Returns a maximum of 10 documents, default no limit. - limit: 10, - // Skip 0 documents, default no offset. - offset: 0, - // Search fields to return, default: ['_id', 'json']. - filter: ['UserId', 'json'], - // How to sort the returned values, default no sort.}] - }; - - var JSONStoreCollections = {}; - JSONStoreCollections[collectionName] = {}; - JSONStoreCollections[collectionName].searchFields = { UserId: 'integer' }; - - WL.JSONStore.init(JSONStoreCollections) - .then(function () { - WL.Logger.debug('Find all colletion data'); - console.log('Find all colletion data'); - - - }).fail(function (err) { - WL.Logger.error(err); - console.log("JsonStore getColletion error ",err) - }); - - const data = WL.JSONStore.get(collectionName).findAll(allOptions).then((value) => { - console.log('Find all colletion data', value); - return JSON.parse(value); - }); - - - return data - - //return notificationData - } - - getColletionById(collectionName, value) { - - var query = { UserId: value }; - - var allOptions = { - // Returns a maximum of 10 documents, default no limit. - limit: 10, - // Skip 0 documents, default no offset. - offset: 0, - // Search fields to return, default: ['_id', 'json']. - filter: ['UserId', 'json'], - // How to sort the returned values, default no sort.}] - }; - - var JSONStoreCollections = {}; - JSONStoreCollections[collectionName] = {}; - JSONStoreCollections[collectionName].searchFields = { UserId: 'integer' }; - - WL.JSONStore.init(JSONStoreCollections) - .then(function () { - WL.Logger.debug('Find colletion data by id'); - console.log('Find colletion data by id'); - - return WL.JSONStore.get(collectionName).find(query, allOptions).then((value) => { - console.log('Find colletion data by id', value); - }); - }).fail(function (err) { - WL.Logger.error(err); - console.log(err) - }); - - } - - replaceDocument(collectionName: string, document: any) { - /* var document = { Example of how identify the document to replace - _id: 1, json: {name: 'chevy', age: 23} - }; - var options = {}; - - WL.JSONStore.get(collectionName).replace(document, options).then(function (numberOfDocsReplaced) { - console.log("JsonStore replace document sucess: ", numberOfDocsReplaced) - }).fail(function (error) { - console.log("JsonStore replace document error: ", error) - }); - } - - removeDocument(collectionName: any,query: any,) { - /* var query = { _id: 1 }; Exemple of query - var options = { exact: true }; - WL.JSONStore.get(collectionName).remove(query, options).then(function (numberOfDocsRemoved) { - console.log("JsonStore remove document sucess: ", numberOfDocsRemoved) - }).fail(function (error) { - console.log("JsonStore remove document erro: ", error) - }); - } */ -} \ No newline at end of file diff --git a/src/app/services/notifications.service.ts b/src/app/services/notifications.service.ts index b24689d0b..8c51f1e6a 100644 --- a/src/app/services/notifications.service.ts +++ b/src/app/services/notifications.service.ts @@ -1,6 +1,5 @@ /* eslint-disable */ /* tslint:disable */ -/* /// */ import { Injectable, NgZone } from '@angular/core'; import { ActivatedRoute } from '@angular/router' import { HttpClient } from '@angular/common/http'; @@ -11,13 +10,12 @@ import { Token } from '../models/token.model'; import { ModalController, AlertController, AnimationController, Platform } from '@ionic/angular'; import { NavigationExtras, Router } from '@angular/router'; import { ToastService } from '../services/toast.service'; -import { JsonStore } from './jsonStore.service'; import { BackgroundService } from './background.service'; import { v4 as uuidv4 } from 'uuid'; import { EventTrigger } from '../services/eventTrigger.service'; import { SessionStore } from '../store/session.service'; -import { FCM } from '@ionic-native/fcm/ngx'; +//import { FCM } from '@ionic-native/fcm/ngx'; //import { FCM } from 'cordova-plugin-fcm-with-dependecy-updated/ionic/ngx'; @Injectable({ @@ -27,7 +25,7 @@ export class NotificationsService { adding: "intervenient" | "CC" = "intervenient"; folderId: string; - DataArray: Array = []; + DataArray = new Array(); callbacks: { type: string, @@ -46,10 +44,9 @@ export class NotificationsService { private toastService: ToastService, private zone: NgZone, private activeroute: ActivatedRoute, - private jsonstore: JsonStore, private eventtrigger: EventTrigger, private backgroundservice: BackgroundService, - private fcm: FCM) { + /* private fcm: FCM */) { this.storageService.get("Notifications").then((value) => { @@ -88,7 +85,7 @@ export class NotificationsService { return this.http.get(`${geturl}`); } - getAndpostToken(username) { +/* getAndpostToken(username) { if (this.platform.is('desktop') || this.platform.is('mobileweb')) { console.log('Notifications not supported') } else { @@ -135,14 +132,14 @@ export class NotificationsService { console.log(data.Object) console.log(data.IdObject) - /* this.DataArray.push(data) + this.DataArray.push(data) console.log("On ReceiveNotification", this.DataArray) - this.storageService.store("Notifications", this.DataArray) */ + this.storageService.store("Notifications", this.DataArray) }; }); - } + } */ ///////////////////////////////////////////////////// diff --git a/src/app/shared/header/header.page.ts b/src/app/shared/header/header.page.ts index de913d563..f5e2bc12c 100644 --- a/src/app/shared/header/header.page.ts +++ b/src/app/shared/header/header.page.ts @@ -6,7 +6,7 @@ import { LoginUserRespose } from 'src/app/models/user.model'; import { ProfilePage } from 'src/app/modals/profile/profile.page'; import { StorageService } from '../../services/storage.service'; import { SessionStore } from 'src/app/store/session.service'; -import { NotificationsService } from '../../services/notifications.service'; +//import { NotificationsService } from '../../services/notifications.service'; import { environment } from 'src/environments/environment'; import { EventTrigger } from '../../services/eventTrigger.service'; import { ThemeService } from '../../services/theme.service'; @@ -35,7 +35,7 @@ export class HeaderPage implements OnInit { private animationController: AnimationController, private storageservice: StorageService, private platform: Platform, - private notificationsService: NotificationsService, + //private notificationsService: NotificationsService, private eventrigger: EventTrigger, public ThemeService: ThemeService ) { @@ -67,7 +67,7 @@ export class HeaderPage implements OnInit { } - UpdateNotificationCount() { + /* UpdateNotificationCount() { this.notificationsService.registerCallback( 'any', () => { @@ -76,7 +76,7 @@ export class HeaderPage implements OnInit { }, 100) } ) - } + } */ notificationLengthData() { this.storageservice.get("Notifications").then((value) => { From 1d58ef0615866ed6eaa9e271928c7337e1dc400f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eudes=20In=C3=A1cio?= Date: Fri, 5 Nov 2021 07:49:01 +0100 Subject: [PATCH 4/9] Push notifications with capacitor runing great --- package-lock.json | 5 + package.json | 1 + src/app/home/home.page.ts | 27 +-- src/app/modals/profile/profile.page.html | 4 +- src/app/modals/profile/profile.page.ts | 34 ++- src/app/models/token.model.ts | 2 +- src/app/pages/events/events.page.ts | 6 - src/app/pages/inactivity/inactivity.page.ts | 8 +- src/app/pages/login/login.page.ts | 8 +- src/app/services/notifications.service.ts | 210 ++++++++++++------- src/app/services/webnotifications.service.ts | 2 +- src/index.html | 24 +++ 12 files changed, 200 insertions(+), 131 deletions(-) diff --git a/package-lock.json b/package-lock.json index 857cf86e5..bad395976 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2162,6 +2162,11 @@ "resolved": "https://registry.npmjs.org/@capacitor/keyboard/-/keyboard-1.1.2.tgz", "integrity": "sha512-EUduhQzrHma4PlGfdSxVeGIwxR2+/xLRDbjQH5Q4cXqrlYssIX2UyQrL4wNpDaAOg1Z4VD8EzzVolC81LG6Q+A==" }, + "@capacitor/push-notifications": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@capacitor/push-notifications/-/push-notifications-1.0.7.tgz", + "integrity": "sha512-vbvAptFq5cI6xKYYWMb7tsWvA88/PTG4v6ptxN0Ygtc1fQ4l/AzONQiYqdtFpbBhF2fML2kXQ/5eSAfn8HY9aw==" + }, "@capacitor/status-bar": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@capacitor/status-bar/-/status-bar-1.0.5.tgz", diff --git a/package.json b/package.json index 67bc368d0..92ffef029 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "@capacitor/core": "^3.3.0", "@capacitor/haptics": "^1.1.2", "@capacitor/keyboard": "^1.1.2", + "@capacitor/push-notifications": "^1.0.7", "@capacitor/status-bar": "^1.0.5", "@fortawesome/angular-fontawesome": "^0.9.0", "@fortawesome/fontawesome-free": "^5.15.3", diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts index 66d63b16e..d3f69aa73 100644 --- a/src/app/home/home.page.ts +++ b/src/app/home/home.page.ts @@ -2,8 +2,8 @@ /* tslint:disable */ import { Component, OnInit, NgZone } from '@angular/core'; import { Event } from '../models/event.model'; -/* import { NotificationsService } from '../services/notifications.service'; -import { WebNotificationsService } from '../services/webnotifications.service'; */ +import { NotificationsService } from '../services/notifications.service'; +/*import { WebNotificationsService } from '../services/webnotifications.service'; */ import { AlertController, Platform } from '@ionic/angular'; import { Router, ActivatedRoute } from '@angular/router'; import { ToDayEventStorage } from '../store/to-day-event-storage.service'; @@ -14,7 +14,7 @@ import { InativityService } from '../services/inativity.service'; import { SessionStore } from '../store/session.service'; import { StorageService } from '../services/storage.service'; import { File } from '@ionic-native/file/ngx'; -import { WebNotificationPopupService } from '../services/notification/web-notification-popup.service'; +/* import { WebNotificationPopupService } from '../services/notification/web-notification-popup.service'; */ import { DocumentCounterService } from '../services/worker/document-counter.service'; import { PermissionService } from '../services/worker/permission.service'; import { Network } from '@ionic-native/network/ngx'; @@ -24,7 +24,6 @@ import { Storage } from '@ionic/storage'; import { EventsService } from 'src/app/services/events.service'; import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx'; - @Component({ selector: 'app-home', templateUrl: './home.page.html', @@ -70,7 +69,7 @@ export class HomePage implements OnInit { private zone: NgZone, private router: Router, public modalCtrl: AlertController, - /* private notificationsService: NotificationsService, */ + private notificationsService: NotificationsService, private platform: Platform, private activeroute: ActivatedRoute, /* private webnotification: WebNotificationsService, */ @@ -79,14 +78,14 @@ export class HomePage implements OnInit { private despachoRule: DespachoService, private inativityService: InativityService, private storageService: StorageService, - private webNotificationPopupService: WebNotificationPopupService, + /* private webNotificationPopupService: WebNotificationPopupService, */ private backgroundservice: BackgroundService, private offlinemanager: OfflineManagerService, private storage: Storage, private eventservice: EventsService, private screenOrientation: ScreenOrientation,) { - this.webNotificationPopupService.askNotificationPermission() + /* this.webNotificationPopupService.askNotificationPermission() */ this.router.events.subscribe((val) => { document.querySelectorAll('ion-modal').forEach((e: any) => e.remove()) @@ -114,6 +113,8 @@ export class HomePage implements OnInit { ngOnInit() { + this.notificationsService.onReciveForeground(); + this.notificationsService.onReciveBackground(); window.addEventListener('online', () => { console.log('Became online') @@ -143,12 +144,12 @@ export class HomePage implements OnInit { updateList() { - /* this.notificationsService.registerCallback( - 'despachos', - () => { - this.despachoRule.getList({ updateStore: true }) - } - ) */ + /* this.notificationsService.registerCallback( + 'despachos', + () => { + this.despachoRule.getList({ updateStore: true }) + } + ) */ document.addEventListener('pause', function () { // console.log('App going to background'); diff --git a/src/app/modals/profile/profile.page.html b/src/app/modals/profile/profile.page.html index ff5276b6e..5069a3183 100644 --- a/src/app/modals/profile/profile.page.html +++ b/src/app/modals/profile/profile.page.html @@ -56,8 +56,8 @@

{{item.Location}}

-

{{item.alert}}

-

{{item.desc}}

+

{{item.title}}

+

{{item.body}}