esl / MongoosePush

MongoosePush is a simple Elixir RESTful service allowing to send push notification via FCM and/or APNS.
Apache License 2.0
108 stars 24 forks source link

Question - Is it possible to disable Push Notifications based on a user's 'Do not disturb' status? #200

Closed dustinswan closed 2 years ago

dustinswan commented 2 years ago

We'd like to disable displaying Push Notifications on our mobile applications if the user has a status of DnD.

Our clients might be able to implement this logic, but if they're running in the background when the notification comes in, they'd have to make a network request which we'd like to avoid.

I'm search around but not finding how any XMPP-based services implement this.. Do most do client-side logic?

aleklisi commented 2 years ago

@dustinswan Does your backend know if someone is in DnD mode/status? If it is the case you can simply make:

if user.status != DnD { send(push_notification)}

instead of

send(push_notification)

Alternatively, see if setting up different priorities for a push notification would help: https://firebase.google.com/docs/cloud-messaging/android/message-priority

dustinswan commented 2 years ago

I'll give this a try! Thanks.