Merge branch 'main' of https://gitea.xeovalyte.dev/xeovalyte/wrbapp
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
merging
This commit is contained in:
commit
56fe3bc549
@ -32,6 +32,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)
|
||||||
@ -121,6 +122,23 @@ 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
|
||||||
|
|
||||||
|
|
||||||
|
fetch('https://api.xeovalyte.com/subscribetotopic', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
Authorization: 'Basic WGVvdmFseXRlOmtNKjhuRXMzNTchalJlXm1KYnZrRSFOIw==',
|
||||||
|
'content-type': 'application/json'
|
||||||
|
},
|
||||||
|
body: JSON.stringify({ topic: 'all', registrationToken: token.value })
|
||||||
|
}).then(response => response.json())
|
||||||
|
.then(response => {
|
||||||
|
console.log(response)
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.log(err)
|
||||||
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -226,5 +244,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>
|
@ -27,5 +27,5 @@ definePageMeta({
|
|||||||
title: 'Home',
|
title: 'Home',
|
||||||
})
|
})
|
||||||
|
|
||||||
const { userPersons } = inject('firebase')
|
const { userPersons, registrationToken } = inject('firebase')
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user