diff --git a/.gitignore b/.gitignore index 2afc5ea1a..2884ea598 100644 --- a/.gitignore +++ b/.gitignore @@ -59,6 +59,7 @@ android/** !android/app/ android/app/** !android/app/src +!android/app/google-services.json android/app/src/** !android/app/src/build.gradle !android/app/src/main diff --git a/android/app/google-services.json b/android/app/google-services.json new file mode 100644 index 000000000..0a455bcff --- /dev/null +++ b/android/app/google-services.json @@ -0,0 +1,40 @@ +{ + "project_info": { + "project_number": "800733765231", + "firebase_url": "https://gabinete-digital-2020.firebaseio.com", + "project_id": "gabinete-digital-2020", + "storage_bucket": "gabinete-digital-2020.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:800733765231:android:e7ffc0b310037d9f13779a", + "android_client_info": { + "package_name": "com.gpr.gabinetedigital" + } + }, + "oauth_client": [ + { + "client_id": "800733765231-92oa7ib62ob0pkouphb5i5sp01vkalid.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyD0pfW45DLoW6mqvZRklJdbfSTskW22Fok" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "800733765231-92oa7ib62ob0pkouphb5i5sp01vkalid.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/package.json b/package.json index 25991aade..0b4d7ada1 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "dev:share": "lite-server --baseDir=share", "install:chromium": "node node_modules/puppeteer/install.js", "build:version": "node ./version/git-version.js", - "ionic-build": "ionic cap run android --prod" + "ionic-build": "ionic cap run android --prod", + "prepare": "husky install" }, "private": true, "dependencies": { diff --git a/src/app/models/notifications.ts b/src/app/models/notifications.ts index 769a2ad5c..97c38a9dd 100644 --- a/src/app/models/notifications.ts +++ b/src/app/models/notifications.ts @@ -13,6 +13,7 @@ const object = [ 'diplomas', 'expedientes-pr', 'despachos', + '*', ] as const; -export type IdObject = typeof object[number]; \ No newline at end of file +export type notificationObject = typeof object[number]; \ No newline at end of file diff --git a/src/app/services/notifications.service.ts b/src/app/services/notifications.service.ts index b069c6961..f6d7b6238 100644 --- a/src/app/services/notifications.service.ts +++ b/src/app/services/notifications.service.ts @@ -15,7 +15,7 @@ import { v4 as uuidv4 } from 'uuid'; import { EventTrigger } from '../services/eventTrigger.service'; import { SessionStore } from '../store/session.service'; import { ActionPerformed, PushNotificationSchema, PushNotifications, Token, } from '@capacitor/push-notifications'; -import { IdObject } from '../models/notifications'; +import { notificationObject } from '../models/notifications'; /* import { Events } from 'ionic-angular' */ @Injectable({ @@ -28,7 +28,7 @@ export class NotificationsService { DataArray = new Array(); callbacks: { - type: string, + type: notificationObject, funx: Function id: string }[] = [] @@ -52,7 +52,7 @@ export class NotificationsService { /* private fcm: FCM */) { } - registerCallback(type: IdObject, funx: Function, object: any = {}) { + registerCallback(type: notificationObject, funx: Function, object: any = {}) { const id = uuidv4() this.callbacks.push({ type, funx, id }) @@ -63,6 +63,27 @@ export class NotificationsService { return id; } + // registerCallback({type, funx, id = uuidv4()}:{ + // type: notificationObject, + // funx: Function + // id?: string + // }) { + + // this.callbacks.push({ type, funx, id }) + + // return id; + // } + + private runNotificationCallback(notification) { + this.callbacks.forEach((data) => { + if(data.type == notification.data.IdObject) { + data.funx({notification}) + } else if (data.type == '*') { + + } + }) + } + deleteCallback(id) { this.callbacks.forEach((e, index) => { if (e.id == id) { @@ -155,6 +176,7 @@ export class NotificationsService { } }) + this.runNotificationCallback(notification) /* this.eventTriger.publish('notificatioRecive') */ this.eventtrigger.publishSomeData({ notification: "recive" @@ -174,6 +196,7 @@ export class NotificationsService { notification: "recive" }) */ this.notificatinsRoutes(notification) + this.runNotificationCallback(notification) } ); } diff --git a/version/git-version.ts b/version/git-version.ts index deac3c192..657f07974 100644 --- a/version/git-version.ts +++ b/version/git-version.ts @@ -1,12 +1,12 @@ export let versionData = { - "shortSHA": "7fbe4abdd", - "SHA": "7fbe4abddf5aadf72d781e9c140f6364b5f164e3", + "shortSHA": "12612a360", + "SHA": "12612a360050a996f4b8067694513685280caeac", "branch": "no_bug_movemente", "lastCommitAuthor": "'Peter Maquiran'", - "lastCommitTime": "'Mon Jan 16 09:06:12 2023 +0100'", - "lastCommitMessage": "save", - "lastCommitNumber": "4626", + "lastCommitTime": "'Mon Jan 16 15:45:08 2023 +0100'", + "lastCommitMessage": "fix ui", + "lastCommitNumber": "4627", "change": "", - "changeStatus": "On branch no_bug_movemente\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: .gitignore\n\tmodified: src/app/shared/header/header.page.html", + "changeStatus": "On branch no_bug_movemente\nAll conflicts fixed but you are still merging.\n (use \"git commit\" to conclude merge)\n\nChanges to be committed:\n\tmodified: .gitignore\n\tnew file: android/app/google-services.json\n\tmodified: package.json\n\tmodified: src/app/models/notifications.ts\n\tmodified: src/app/services/notifications.service.ts\n\tmodified: version/git-version.ts", "changeAuthor": "peter.maquiran" } \ No newline at end of file