2

In a React Native app, usingRedux and Redux-Persist, what is the best way to identify what content needs to be updated?

I have an app that does a few requests at startup. When I enabled redux-persist I started to avoid a request if it was already done at another time. But I have no idea how best to identify whether or not to make the request again to update the data stored by redux-persist.

I read about the use of ETags andLast-Modified, but this implies implementing this in the API also right?

Any guidance for this functionality implemented in the right way?

1 Answers1

0

Yes, you also need to update your API.

Another solution is to use push notifications to notify that the data changed and perform a new request every time the notification is received. But this also means implementing some code on server side.

You need a way to know that the data changed, for that reason you always need to implement some code in server side.

Sandro Machado
  • 9,921
  • 4
  • 36
  • 57
  • Understand. But adding push notifications just to identify updates is not something very intrusive for the user? – Luciano Lima Sep 17 '17 at 23:31
  • You can use silent push notifications. See more about it here: https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH10-SW1 – Sandro Machado Sep 17 '17 at 23:34
  • Thanks. I will check! – Luciano Lima Sep 19 '17 at 12:39