react-native-background-actions
React Native background service library for running background tasks forever in Android & iOS. Schedule a background job that will run your JavaScript when your app is in the background or foreground.
WARNING
- Android: This library relies on React Native’s
HeadlessJS
for Android. Before building your JS task, make sure to read all the documentation. The jobs will run even if the app has been closed. - iOS: This library relies on iOS’s
UIApplication beginBackgroundTaskWithName
method, which won’t keep your app in the background forever by itself. However, you can rely on other libraries likereact-native-track-player
that use audio, geolocalization, etc. to keep your app alive in the background while you execute the JS from this library.
Install:
Getting started:-
Install Using yarn :
yarn add react-native-background-actions
Or Install Using npm :
npm install --save react-native-background-actions
Compatibility:-
To use this library you need to ensure you are using the correct version of React Native. If you are using a version of React Native that is lower than 0.47
you will need to upgrade before attempting to use this library latest version.
Linking:-
Using React Native >= 0.60:
Linking the package manually is not required anymore with Autolinking.
- iOS Platform:
$ cd ios && pod install && cd ..
// CocoaPods on iOS needs this extra step

- Android Platform:
Modify your android/app/src/main/AndroidManifest.xml
and add the following:
<manifest ... > ... <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> ... <application ... > ... <service android:name="com.asterinet.react.bgactions.RNBackgroundActionsTask" /> </application> </manifest>
Using React Native < 0.60:
You then need to link the native parts of the library for the platforms you are using. The easiest way to link the library is using the CLI tool by running this command from the root of your project:
$ react-native link react-native-background-actions
If you can’t or don’t want to use the CLI tool, you can also manually link the library using the instructions below (click on the arrow to show them):
Check Usage Here : react-native-background-actions Usage
GitHub:- https://github.com/Rapsssito/react-native-background-actions
Please Do Ask Or Suggest In Comment.
Do Follow Us on:
Also Check out: A Performant And Easy to use hold to open context menu for React Native

I am passionate about my work. Because I love what I do, I have a steady source of motivation that drives me to do my best. In my last job, this passion led me to challenge myself daily and learn new skills that helped me to do better work
[…] Also Checkout: React Native background service library for running background tasks forever […]