$ npm install --save react-native-background-fetch
$ react-native link react-native-background-fetch
- 📂
android/build.gradle
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
// Google now hosts their latest API dependencies on their own maven server.
// React Native will eventually add this to their app template.
+ maven {
+ url 'https://maven.google.com'
+ }
}
}
📂 android/app/build.gradle
+repositories {
+ flatDir {
+ dirs "../../node_modules/react-native-background-fetch/android/libs"
+ }
+}
dependencies {
+ compile(name: 'tsbackgroundfetch', ext: 'aar')
}