SmoggeR_js
SmoggeR_js

Reputation: 3150

Is there any way to do background tasks in React Native other than react-native-background-task?

I'm trying to do in my React Native App that each X min the app fetch some data of my application included if the app is closed. Or more similar, each X min I want to save a value in the AsyncStorage.

It suppose that the react-native-background-task does that but, unfortunately, the project is abandoned with a lot of errors and bugs that make using it unviable.

Is there any other way to do it?

Upvotes: 2

Views: 8059

Answers (2)

Suraj Malviya
Suraj Malviya

Reputation: 3773

For android, background service works fine which has its RN implementation in form of Headless JS task. For iOS, there is no such ready made library to be used in RN. iOS being restrictive doesn't allows applications to take on the job queue control of OS straight away, though in native OS API, there are ways such things as per the business requirements.

You can refer this to better understand which option to use for your use-case and can come up with a bridging module for RN as well.

Upvotes: 2

abhinandan sharma
abhinandan sharma

Reputation: 883

Have you tried react-native-queue.I think it will suit your requirement.

Click here For complete guide.

You can try react-native-background-jobtoo.

Click Here for Complete Guide

Upvotes: 0

Related Questions