Replies: 1 comment 1 reply
-
|
data-only notifications are designed to be unreliable - we refer to them as "data only notifications" but note that in apple docs they are co-mingled with the idea of "content refresh". That is "hey, there is maybe some content for the app that you could refresh in the background - like some new news headlines - and the user experience will be slightly better if you pre-fetch vs if you have to fetch when you open the app" That's the level of reliability intended for background / no-visible-notification push notifications on iOS. It is how they designed it. In that context, does it make sense to design a system where "notification in-time are the main part of the app" using a transmission mechanism where the delivery contract is "we may deliver this or not, with no guarantees, and a design philosophy where non-delivery is inherent in the design" ? I would not You may want to look in to notification service extensions so that you can display things differently while still using the delivery contracts you want, which are only available with visible (not data-only) notifications on iOS This is an iOS design philosophy issue, not a react-native-firebase or notifee thing, unfortunately. We can only work with what the platform provides |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all.
Let me first start from what I need based on the application we are building; when some events happen, we are sending two different types of notifications:
Based on the requirements, we are using
data-onlynotification because sometimes, even if we send something to the device, it does not mean we are going to display it. Therefore, if I would send anotificationmessage, I have no idea how to perform the roaming ones.Speaking about what we are using, we have:
firebase-admin/messagingon the backendnotifeeNow, let's (partially) see what we have from a code point of view. On the backend, we have this:
As you can see, we are sending
data-only, and the reasons why theapnsandandroidare set are so is defined here: https://rnfirebase.io/messaging/usage#data-only-messagesFrom what concern the RN side, we have these part of code in the app:
Then, in both
notificationBuilderandnotificaitonBuilderForegroundwe have the logic where we check:Now, the real question is: how reliable this implementation is?
I'm using
data-onlynotification, and I've read on this repo itself that they're not that reliable:We have made so that users know they must:
One last thing to add is what problem we were facing: from time to time, notifications were NOT delivered, unless user opened the app: at that point, he got all the notification he didn't get from the last app opening.
Finally, we just changed the backend to use
apns-push-type: backgroundandapns-priority: 5based on Firebase documentation, but from Apple documentation itself it appears we should use what we had before (apns-push-type: alertandpriority: 5).As said, what we had before was having the issue I described, while it seems that right now, with latest change, the problem is gone. But, I'd like to know how much reliable this is, because notification in-time are the main part of the app we are developing (we can accept a 10/15sec delay for throttling, but not more)
Beta Was this translation helpful? Give feedback.
All reactions