SudoPlz
SudoPlz

Reputation: 23243

What are the gotchas of using push notifications for realtime updates?

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:

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

Answers (1)

tyczj
tyczj

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

Related Questions