As far as I know, push notification can be used in react native, even when the app is closed. would it be possible to use push notification to run a background task in react native?
for example, when a push notification is sent to a device, it runs a function to fetch data from server and update database.
https://github.com/zo0r/react-native-push-notification
Push notification and data notification handling part could be done using react-native-firebase easily (I recommend to use react-native-firebase instead of react-native-push-notification because it has wide community support and support for many more firebase services)
And in here it show how to fetch data in background for iOS; with the few modification same thing could be done in android also.
Useful links :
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With