added token notifier
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
xeovalyte 2022-11-13 19:48:40 +01:00
parent c2ef9797f8
commit 4d3bdcbb6e
2 changed files with 6 additions and 3 deletions

View File

@ -29,6 +29,7 @@ const route = useRoute()
const isAuthenticated = ref(false) const isAuthenticated = ref(false)
const user = ref('frikandel') const user = ref('frikandel')
const registrationToken = ref('')
const auth = ref(null) const auth = ref(null)
const userLoaded = ref(false) const userLoaded = ref(false)
const userData = ref(null) const userData = ref(null)
@ -118,6 +119,7 @@ const setupNotifications = () => {
PushNotifications.addListener('registration', PushNotifications.addListener('registration',
(token) => { (token) => {
// alert('Push registration success, token: ' + token.value); // alert('Push registration success, token: ' + token.value);
registrationToken.value = token
} }
); );
@ -223,5 +225,5 @@ const logDeviceInfo = async () => {
const ledenlijst = ref([]) const ledenlijst = ref([])
provide('firebase', { db, ledenlijst, isAuthenticated, user, userData, userPersons, auth, userAllPersons, getPersons, calEvents, news }) provide('firebase', { db, ledenlijst, isAuthenticated, user, userData, userPersons, auth, userAllPersons, getPersons, calEvents, news, registrationToken })
</script> </script>

View File

@ -17,6 +17,7 @@
<span>Settings</span> <span>Settings</span>
<Icon class="ml-auto" size="2em" name="ion:arrow-forward"/> <Icon class="ml-auto" size="2em" name="ion:arrow-forward"/>
</NuxtLink> </NuxtLink>
{{ registrationToken }}
</div> </div>
</div> </div>
@ -27,5 +28,5 @@ definePageMeta({
title: 'Home', title: 'Home',
}) })
const { userPersons } = inject('firebase') const { userPersons, registrationToken } = inject('firebase')
</script> </script>