OneSignal / onesignal-ngx

OneSignal Angular
Other
5 stars 6 forks source link

[Bug]: The notifications are not delivered, when using Angular pwa and OneSignal together #43

Open ertugrulbakidal opened 8 months ago

ertugrulbakidal commented 8 months ago

What happened?

Although I registered OneSignal different scope than PWA service worker, It's causing issues. In the devtools service workers tab this can be observed that OneSignal service worker is stopped accordingly the notifications are not delivered.

What browsers are you seeing the problem on?

Chrome (Chromium)

What operating system are you running?

Windows 11

Steps to reproduce?

Node version: 18.16.0
Angular version: 16.1.0
NPM version: 9.5.1
onesignal-ngx version: 2.0.1

I created a repo to reproduce the issue. https://github.com/ertugrulbakidal/AngularWithOneSignal

- Change the OneSignal app id
- Install dependencies
- run ng build
- npm install --global http-server
- npx http-server -p 4200 -c-1 .\dist\angular-pwa-with-one-signal\

What did you expect to happen?

The OneSignal notifications should be delivered while using Angular PWA

Relevant log output

No response

jkasten2 commented 8 months ago

@ertugrulbakidal Thanks for reporting. I believe there is a race condition bug in the OneSignal-Website-SDK where it can sometimes pick up the wrong Service Worker when registering for push. This is something we are looking into.

ryanvu commented 3 weeks ago

Has there been any progress on this?

My Service worker is attached, but not receiving Push Notifications on Chrome