Skip to content
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

Add callbacks to respond back o UI when registering #44

Open
paulincai opened this issue Oct 13, 2021 · 2 comments
Open

Add callbacks to respond back o UI when registering #44

paulincai opened this issue Oct 13, 2021 · 2 comments
Assignees
Labels

Comments

@paulincai
Copy link
Contributor

e.g. I want to subscribe to Notifications. My browser blocks notification. activitree:push can sense this and return this message to UI.

Logic: Press "Subscribe" -> receive message: Please allow your browser to receive notifications.

@paulincai paulincai self-assigned this Oct 13, 2021
@paulincai
Copy link
Contributor Author

Implemented scenario:
* User Signs-in on this device. The user in Meteor has opted in the past to receive Push notifications from this app.
* He is supposed to receive Push on whichever devices is enabled by the user to provide these Push Notifications.
* I try to get a token. If I get one (browser gives it to me) I save this userId in Mongo associated with this token. If there was already a user on the token I overwrite the old user.
* If the browser blocks me, tell the user he is set to receive Push notifications but the browser blocks that.
* If the user is not set to receive Push just disregard everything. (do not call a getToken)
* When the user logs out the app from a browser, unsubscribe the user from notifications in that browser.

@paulincai
Copy link
Contributor Author

This is now completed. Callbacks added will just need to add the documentation and a React component as example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant