This sample web do not work in my server
I've published this sample web in my server replacing the vapid key with my own one generated with your instructions, but when I push the suscribe to notifications button, I get an error:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'pushManager') at subscribeToPush (frontend.js:44:35)
What is the problem? (I use Microsoft IIS)
Problem Solved. I had to change the scope in register: let swRegistration = await navigator.serviceWorker.register('https://******./serviceworker.js', {scope: '/'})
This sample works fine in android devices. Is possible to make it works in chrome for desktop too?
Hello! You can check in "chrome for desktop" original example https://andreinwald.github.io/webpush-ios-example If it works - then answer in changes that you did or should do in your version of code.
Hello, Where could I find chrome for desktop original example?
https://andreinwald.github.io/webpush-ios-example
Works in my Chrome on MacOS
Ok, I thought that It worked in chrome for windows too. But not. Thanks
De: Andrii Reinvald @.> Enviado el: martes, 15 de octubre de 2024 14:34 Para: andreinwald/webpush-ios-example @.> CC: marcoahp @.>; Author @.> Asunto: Re: [andreinwald/webpush-ios-example] This sample web do not work in my server (Issue #2)
https://andreinwald.github.io/webpush-ios-example
Works in my Chrome on MacOS
— Reply to this email directly, view it on GitHub https://github.com/andreinwald/webpush-ios-example/issues/2#issuecomment-2413790794 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AL3J4T5NP4GR5J2CPEQI7U3Z3UDVHAVCNFSM6AAAAABPYLEG66VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMJTG44TANZZGQ . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AL3J4TZAUTCFCSMB7IEF23TZ3UDVHA5CNFSM6AAAAABPYLEG66WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUP36DEU.gif Message ID: @.*** @.***> >