From 4d3bdcbb6e0f07adb40e81b3b02d7e7ae7832383 Mon Sep 17 00:00:00 2001 From: xeovalyte Date: Sun, 13 Nov 2022 19:48:40 +0100 Subject: [PATCH] added token notifier --- frontend/app.vue | 6 ++++-- frontend/pages/index.vue | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/app.vue b/frontend/app.vue index e87a32b..7ee388d 100644 --- a/frontend/app.vue +++ b/frontend/app.vue @@ -29,6 +29,7 @@ const route = useRoute() const isAuthenticated = ref(false) const user = ref('frikandel') +const registrationToken = ref('') const auth = ref(null) const userLoaded = ref(false) const userData = ref(null) @@ -118,6 +119,7 @@ const setupNotifications = () => { PushNotifications.addListener('registration', (token) => { // alert('Push registration success, token: ' + token.value); + registrationToken.value = token } ); @@ -223,5 +225,5 @@ const logDeviceInfo = async () => { const ledenlijst = ref([]) -provide('firebase', { db, ledenlijst, isAuthenticated, user, userData, userPersons, auth, userAllPersons, getPersons, calEvents, news }) - \ No newline at end of file +provide('firebase', { db, ledenlijst, isAuthenticated, user, userData, userPersons, auth, userAllPersons, getPersons, calEvents, news, registrationToken }) + diff --git a/frontend/pages/index.vue b/frontend/pages/index.vue index b8efd55..374f187 100644 --- a/frontend/pages/index.vue +++ b/frontend/pages/index.vue @@ -17,6 +17,7 @@ Settings + {{ registrationToken }} @@ -27,5 +28,5 @@ definePageMeta({ title: 'Home', }) -const { userPersons } = inject('firebase') +const { userPersons, registrationToken } = inject('firebase')