1.1.1 • Published 5 years ago

react-native-background-jobs v1.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

react-native-background-jobs

Getting started

$ npm install react-native-background-jobs --save

Mostly automatic installation

Linking is done automatically.

Usage

  1. Open up android/app/src/main/AndroidManifest
  • Add <service android:name="kendhia.reactlibrary.BackgroundJobsService" />.
  • Add the following permissions:
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
  1. Inside your index.js
    • Register the service the same way you register your app. AppRegistry.registerHeadlessTask('BackgroundJobsEvent', () => BackgroundJobsEvent);
    • Now, you can define the code you want to be running forever. Ex:
    const BackgroundJobsEvent = async () => {
    	console.log("running forever...")
    };

// TODO:Enrich the Readme I know this readme file might not be so much understandable. I'll try to update it asap.

1.1.1

5 years ago

1.1.0

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago