i want to connect to my application by phone and save token device in firestore.I run my app on https://192.IP address. I can sign in but token is not added to my firestore. if i run my app on http://localhost, i'am able to save my device token. but not on phone.
this is how i call firebase-messaging-sw.js
window.addEventListener('load', () => {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/firebase-messaging-sw.js')
.then(registration => {
messaging.useServiceWorker(registration)
initializePush()
})
.catch(err => console.log('Service Worker Error', err))
}
})
i always get this error.
Service Worker Error TypeError: Failed to register a ServiceWorker: A bad HTTP response code (404) was received when fetching the script.
i want to connect to my application by phone and save token device in firestore.I run my app on https://192.IP address. I can sign in but token is not added to my firestore. if i run my app on http://localhost, i'am able to save my device token. but not on phone. this is how i call firebase-messaging-sw.js