Open ghost opened 3 years ago
Hi Mr4FX
swRegistration is defined on line 7 with value null. On line 124 you try to read pushManager from swRegistration. This is not possible because there is no property "pushManager" in null (swRegistration). swRegistration will be changed on line 30 to swReg but line 124 has been executed earlier. Lines 123 to 145 must be placed inside a function for it to be executed when a button is pressed. The code will not be executed / the button will be unavailable until the service worker is registered. However, these lines are already placed in a function on lines 103 to 121. So your code is a duplicate here. It is enough to delete lines 123 to 145. The code should now work.
I hope I have been able to help you. Let me know if you have any questions.
the code i used is
hey, after following the steps on Docs unfortunately i can't understand why pushManager is not working i tried to click push on webDev but nothing happened.
the User is already subscribed. thanks