-
-
Notifications
You must be signed in to change notification settings - Fork 150
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
fix: notification insanity #824
fix: notification insanity #824
Conversation
Nope. Can't do this because Apple punishes silent notifications. https://dev.to/progressier/how-to-fix-ios-push-subscriptions-being-terminated-after-3-notifications-39a7 |
So, now the "fix" is:
|
This might still cause issues if getting the data from IndexedDB takes too much time. iOS wants devs to fire a notification immediately. Possible solution: fire notification immediately and then close it afterwards. Note: only do this if the above solution does not work. |
Looks like the only solution is to not use topic based notifications and send notifications to each user individually. |
…sent-by-the-sender-in-channels
…sent-by-the-sender-in-channels
Push notifications were being sent to the user who sent the message (only in channels - since topics)
Implemented the following:
On logging in - add current user ID to indexed DB.
On logging out - clear it.
In the service worker, fetch current user from IndexedDB and check if the message was sent by the current user. If not, create notification.
Tested this for a bit - seems to work fine. Sometimes the push notification doesn't fire (usually when the app is killed/started) - will investigate. This is hopefully not happening because of this change.
Other changes:
message_update
event so that it works. The desk integration needs to be updated soon with pagination, polls etc.