added subscribe to topic
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
4d3bdcbb6e
commit
28e9fd8e30
@ -120,6 +120,22 @@ const setupNotifications = () => {
|
||||
(token) => {
|
||||
// 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: currentToken })
|
||||
}).then(response => response.json())
|
||||
.then(response => {
|
||||
console.log(response)
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err)
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user