-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation/Recipe around integrating/interfacing ember-service-worker with an Ember Service. #78
Comments
Have you ever found anything on this subject? I found this resource: https://developers.google.com/web/fundamentals/push-notifications/common-notification-patterns It seems like you would need messages for this. Something like this on the service side?
I'm not really sure when to add this listener. In an initialiser? Or on the And we need this on the service worker side:
To get a client the service worker needs to inspect |
Instead of relying on postMessage, I would either store it in Local Storage or IndexedDB if it's not sensitive data, or fetch it from the server if it is. The SW has free access to IDB and LS. |
Why would you not use postMessage? Browser support? Using the server does not really make sense to me for push notifications, since you would then need a push notification from the server that it has a message ;) But LocalStorage (or SessionStorage) seems like a good alternative with the |
For context, I'm looking to use ember-service-worker to facilitate push notifications using the PushSubscription API.
My app has a service which is responsible for maintaining user session information, and I would like to expose that session service to the service worker, so that it can map push subscriptions to a specific user. I imagine this is a fairly common pattern for folks who are looking to use service workers for the purpose of push subscriptions, however the documentation seems geared solely towards using service workers for the purpose of making apps offline first.
The text was updated successfully, but these errors were encountered: