How can I run background tasks in React Native?
Currently, there is, unfortunately, no support for background tasks of any kind. The feature you are referring to would be a background timer. Such a timer is this product pain (a feature request) for react native, you may upvote it to show an increased demand for this feature.
EDIT 12/2016: There is still no real option. You have the Headless JS API since RN 0.33, but it is only for android. Also your App will crash if this runs in the foreground so you have to be careful about using it. Thanks to @Feng for pointing that out.
What is the best way to run background task in react native?
I'd recommend React Native Background Task, though it cannot execute your task reliably at a specific time (ie: 14:30 might execute at 14:50), it is explained in the git hub page as
The exact timings of task execution are unpredictable, as both Anrdoid and iOS use black-box algorithms, which depend on factors like device sleep state. This library should only be used for tasks that are an incremental feature, and can have inexact timing, such as the periodic background syncing of data. You should be prepared for the case that background task doesn't fires at all.
Run a function periodically in background mode in react native
There is no way to make API calls in the background for iOS devices as Apple Policy restrict developer to run tasks in background iOS.
So, If you are looking to make API calls in the background for Android devices.
Then you can use the below dependency to run API calls in the background.
React Native Background Fetch
Related Topics
How to Transition the Flex-Grow of a Flex Box to Produce an Animation
How to Change Fontsize by JavaScript
How to Get Just Numeric Part of CSS Property with Jquery
Add a Transform Value to the Current Transforms That Are Already on the Element
Jquery in Chrome Returns "Block" Instead of "Inline"
Serving Gzipped CSS and JavaScript from Amazon Cloudfront via S3
Screen Styling When Virtual Keyboard Is Active
How to Fetch the Value of a Non-Standard CSS Property via JavaScript
Simulate Background-Size:Cover on <Video> or <Img>
Using Jquery to Know When @Font-Face Fonts Are Loaded
Better Way to Prevent Browser Caching of JavaScript Files
Advantages of Using Prototype, VS Defining Methods Straight in the Constructor