Reputation: 23243
We have a react-native app and wish to force our app to update every time something changes on the server side. We're currently using firebase cloud messaging for delivering push notifications to our (react-native) app but now need a way to add realtime updates too.
We were thinking of just using push notifications (instead of something like mqtt). I'm wondering if there are any problems/limitations that I'm not currently thinking of:
I read in an old SO comment that Apple instructs against using push notifications just for data updating but I can't find any references nowadays.
I know that push notifications are not as "real time" as something like for example MQTT and I think that's fine as long as the delay is not more than a few seconds.
I know there's a payload size limitation of 4kb but that's not an issue for us either
Those push notification messages won't have any visible UI, just the data payload, to make our app update
Are there any other negative side effects that I'm not thinking of right now? Is there any benefit from using something like mqtt?
Upvotes: 1
Views: 575
Reputation: 73773
No experience with react native but from a push notification perspective neither platform guarantees delivery nor do they guarantee delivery in a timely manner. On android; device manufacturers often do things they shouldnt that breaks FCM from delivering notifications to help save battery life.
Your app should not rely completely on push notifications themselves to delivery your content and have some sort of backup like an infrequent polling timer or something just in case.
The benefit of using push notifications over mqtt is that MQTT you need to have a service running in the case of Android and iOS you need your app in foreground to be able to receive messages. Push notifications do not have the limitation due to them being integrated into the OS for the most part
Upvotes: 3