diff --git a/.vs/ProjectSettings.json b/.vs/ProjectSettings.json new file mode 100644 index 00000000..d33b3d63 --- /dev/null +++ b/.vs/ProjectSettings.json @@ -0,0 +1,3 @@ +{ + "CurrentProjectSetting": "Keine Konfigurationen" +} \ No newline at end of file diff --git a/.vs/react-native-background-geolocation/v16/.suo b/.vs/react-native-background-geolocation/v16/.suo new file mode 100644 index 00000000..a89f3b80 Binary files /dev/null and b/.vs/react-native-background-geolocation/v16/.suo differ diff --git a/.vs/react-native-background-geolocation/v16/Browse.VC.db b/.vs/react-native-background-geolocation/v16/Browse.VC.db new file mode 100644 index 00000000..04aa39e3 Binary files /dev/null and b/.vs/react-native-background-geolocation/v16/Browse.VC.db differ diff --git a/.vs/react-native-background-geolocation/v16/Browse.VC.db-shm b/.vs/react-native-background-geolocation/v16/Browse.VC.db-shm new file mode 100644 index 00000000..d5f46a8f Binary files /dev/null and b/.vs/react-native-background-geolocation/v16/Browse.VC.db-shm differ diff --git a/.vs/react-native-background-geolocation/v16/Browse.VC.db-wal b/.vs/react-native-background-geolocation/v16/Browse.VC.db-wal new file mode 100644 index 00000000..19853d1b Binary files /dev/null and b/.vs/react-native-background-geolocation/v16/Browse.VC.db-wal differ diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 00000000..3323f896 Binary files /dev/null and b/.vs/slnx.sqlite differ diff --git a/README.md b/README.md index dbb057d9..4c754d19 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,86 @@ [![CircleCI](https://circleci.com/gh/mauron85/react-native-background-geolocation/tree/master.svg?style=shield)](https://circleci.com/gh/mauron85/react-native-background-geolocation/tree/master) [![issuehunt-shield-v1](issuehunt-shield-v1.svg)](https://issuehunt.io/r/mauron85/react-native-background-geolocation/) -## We're moving +Forked from [@maruon85/react-native-background-geolocation](https://github.com/mauron85/react-native-background-geolocation) due to inactivity. -Npm package is now [@mauron85/react-native-background-geolocation](https://www.npmjs.com/package/@mauron85/react-native-background-geolocation)! +## Installation + +``` +yarn add @mauron85/react-native-background-geolocation +``` + +### Automatic setup + +Since version 0.60 React Native does linking of modules [automatically](https://github.com/react-native-community/cli/blob/master/docs/autolinking.md). However it does it only for single module. +As plugin depends on additional 'common' module, it is required to link it with: + +``` +node ./node_modules/@mauron85/react-native-background-geolocation/scripts/postlink.js +``` + +### Manual setup + +#### Android setup + +In `android/settings.gradle` + +```gradle +... +include ':@mauron85_react-native-background-geolocation-common' +project(':@mauron85_react-native-background-geolocation-common').projectDir = new File(rootProject.projectDir, '../node_modules/@mauron85/react-native-background-geolocation/android/common') +include ':@mauron85_react-native-background-geolocation' +project(':@mauron85_react-native-background-geolocation').projectDir = new File(rootProject.projectDir, '../node_modules/@mauron85/react-native-background-geolocation/android/lib') +... +``` + +In `android/app/build.gradle` + +```gradle +dependencies { + ... + compile project(':@mauron85_react-native-background-geolocation') + ... +} +``` + +Register the module (in `MainApplication.java`) + +```java +import com.marianhello.bgloc.react.BackgroundGeolocationPackage; // <--- Import Package + +public class MainApplication extends Application implements ReactApplication { + ... + /** + * A list of packages used by the app. If the app uses additional views + * or modules besides the default ones, add more packages here. + */ + @Override + protected List getPackages() { + return Arrays.asList( + new MainReactPackage(), + new BackgroundGeolocationPackage() // <---- Add the Package + ); + } + ... +} +``` + +#### iOS setup + +1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]` +2. Add `./node_modules/@mauron85/react-native-background-geolocation/ios/RCTBackgroundGeolocation.xcodeproj` +3. In the XCode project navigator, select your project, select the `Build Phases` tab and in the `Link Binary With Libraries` section add **libRCTBackgroundGeolocation.a** +4. Add `UIBackgroundModes` **location** to `Info.plist` +5. Add `NSMotionUsageDescription` **App requires motion tracking** to `Info.plist` (required by ACTIVITY_PROVIDER) + +For iOS before version 11: + +6. Add `NSLocationAlwaysUsageDescription` **App requires background tracking** to `Info.plist` + +For iOS 11: + +6. Add `NSLocationWhenInUseUsageDescription` **App requires background tracking** to `Info.plist` +7. Add `NSLocationAlwaysAndWhenInUseUsageDescription` **App requires background tracking** to `Info.plist` ## Submitting issues @@ -210,88 +287,6 @@ class BgTracking extends Component { export default BgTracking; ``` -## Instalation - -### Installation - -Add the package to your project - -``` -yarn add @mauron85/react-native-background-geolocation -``` - -### Automatic setup - -Since version 0.60 React Native does linking of modules [automatically](https://github.com/react-native-community/cli/blob/master/docs/autolinking.md). However it does it only for single module. -As plugin depends on additional 'common' module, it is required to link it with: - -``` -node ./node_modules/@mauron85/react-native-background-geolocation/scripts/postlink.js -``` - -### Manual setup - -#### Android setup - -In `android/settings.gradle` - -```gradle -... -include ':@mauron85_react-native-background-geolocation-common' -project(':@mauron85_react-native-background-geolocation-common').projectDir = new File(rootProject.projectDir, '../node_modules/@mauron85/react-native-background-geolocation/android/common') -include ':@mauron85_react-native-background-geolocation' -project(':@mauron85_react-native-background-geolocation').projectDir = new File(rootProject.projectDir, '../node_modules/@mauron85/react-native-background-geolocation/android/lib') -... -``` - -In `android/app/build.gradle` - -```gradle -dependencies { - ... - compile project(':@mauron85_react-native-background-geolocation') - ... -} -``` - -Register the module (in `MainApplication.java`) - -```java -import com.marianhello.bgloc.react.BackgroundGeolocationPackage; // <--- Import Package - -public class MainApplication extends Application implements ReactApplication { - ... - /** - * A list of packages used by the app. If the app uses additional views - * or modules besides the default ones, add more packages here. - */ - @Override - protected List getPackages() { - return Arrays.asList( - new MainReactPackage(), - new BackgroundGeolocationPackage() // <---- Add the Package - ); - } - ... -} -``` - -#### iOS setup - -1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]` -2. Add `./node_modules/@mauron85/react-native-background-geolocation/ios/RCTBackgroundGeolocation.xcodeproj` -3. In the XCode project navigator, select your project, select the `Build Phases` tab and in the `Link Binary With Libraries` section add **libRCTBackgroundGeolocation.a** -4. Add `UIBackgroundModes` **location** to `Info.plist` -5. Add `NSMotionUsageDescription` **App requires motion tracking** to `Info.plist` (required by ACTIVITY_PROVIDER) - -For iOS before version 11: - -6. Add `NSLocationAlwaysUsageDescription` **App requires background tracking** to `Info.plist` - -For iOS 11: - -6. Add `NSLocationWhenInUseUsageDescription` **App requires background tracking** to `Info.plist` -7. Add `NSLocationAlwaysAndWhenInUseUsageDescription` **App requires background tracking** to `Info.plist` ## API diff --git a/android/lib/src/androidTest/java/com/marianhello/bgloc/react/ConfigMapperTest.java b/android/lib/src/androidTest/java/com/marianhello/bgloc/react/ConfigMapperTest.java index 44682bce..fec89814 100644 --- a/android/lib/src/androidTest/java/com/marianhello/bgloc/react/ConfigMapperTest.java +++ b/android/lib/src/androidTest/java/com/marianhello/bgloc/react/ConfigMapperTest.java @@ -1,9 +1,9 @@ package com.marianhello.bgloc.react; import android.content.Context; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; -import android.support.test.filters.SmallTest; +import androidx.test.InstrumentationRegistry; +import androidx.test.runner.AndroidJUnit4; +import androidx.test.filters.SmallTest; import com.facebook.react.bridge.Arguments; import com.facebook.react.bridge.ReadableMap; diff --git a/android/lib/src/main/java/com/marianhello/bgloc/react/BackgroundGeolocationPackage.java b/android/lib/src/main/java/com/marianhello/bgloc/react/BackgroundGeolocationPackage.java index ab25510a..1e5ceac8 100644 --- a/android/lib/src/main/java/com/marianhello/bgloc/react/BackgroundGeolocationPackage.java +++ b/android/lib/src/main/java/com/marianhello/bgloc/react/BackgroundGeolocationPackage.java @@ -1,15 +1,14 @@ package com.marianhello.bgloc.react; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - import com.facebook.react.ReactPackage; -import com.facebook.react.bridge.JavaScriptModule; import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.uimanager.ViewManager; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + public class BackgroundGeolocationPackage implements ReactPackage { @Override diff --git a/android/lib/src/main/java/com/marianhello/bgloc/react/headless/HeadlessService.java b/android/lib/src/main/java/com/marianhello/bgloc/react/headless/HeadlessService.java index 50a31b47..298f6fb9 100644 --- a/android/lib/src/main/java/com/marianhello/bgloc/react/headless/HeadlessService.java +++ b/android/lib/src/main/java/com/marianhello/bgloc/react/headless/HeadlessService.java @@ -2,7 +2,7 @@ import android.content.Intent; import android.os.Bundle; -import android.support.annotation.Nullable; +import androidx.annotation.Nullable; import com.facebook.react.HeadlessJsTaskService; import com.facebook.react.bridge.Arguments; diff --git a/android/settings.gradle b/android/settings.gradle index 5b8f3c93..0d4a8be6 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,3 +1,3 @@ include ':lib' include ':@mauron85_react-native-background-geolocation-common' -project(':@mauron85_react-native-background-geolocation-common').projectDir = new File(rootProject.projectDir, './common') \ No newline at end of file +project(':@mauron85_react-native-background-geolocation-common').projectDir = new File(rootProject.projectDir, './common') diff --git a/package.json b/package.json index 85542742..b3953455 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,44 @@ { - "name": "@mauron85/react-native-background-geolocation", - "version": "0.6.3", - "description": "optimized background location tracking", - "main": "./index.js", - "types": "./index.d.ts", - "scripts": { - "link": "@mauron85/react-native-background-geolocation/scripts/postlink.js", - "unlink": "@mauron85/react-native-background-geolocation/scripts/postunlink.js", - "test": "echo \"Error: no test specified\" && exit 1" + "_args": [ + [ + "@mauron85/react-native-background-geolocation@0.6.6", + "C:\\Users\\Denni\\source\\repos\\CronosZone\\smartphoneApp\\kuckuck" + ] + ], + "_from": "@mauron85/react-native-background-geolocation@0.6.6", + "_id": "@mauron85/react-native-background-geolocation@0.6.6", + "_inBundle": false, + "_integrity": "sha512-IQHSg4ybq8qDdf4mNZPqvV5Z2vTBKp1ehuqrc2zDdtJr7ihLTsQMGjhiGZ0BLVL+pwdOKrp0Q/TP3lFVfpyRKA==", + "_location": "/@mauron85/react-native-background-geolocation", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "@mauron85/react-native-background-geolocation@0.6.6", + "name": "@mauron85/react-native-background-geolocation", + "escapedName": "@mauron85%2freact-native-background-geolocation", + "scope": "@mauron85", + "rawSpec": "0.6.6", + "saveSpec": null, + "fetchSpec": "0.6.6" }, - "repository": { - "type": "git", - "url": "git+https://github.com/mauron85/react-native-background-geolocation.git" + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/@mauron85/react-native-background-geolocation/-/react-native-background-geolocation-0.6.6.tgz", + "_spec": "0.6.6", + "_where": "C:\\Users\\Denni\\source\\repos\\CronosZone\\smartphoneApp\\kuckuck", + "author": { + "name": "Marian Hello" }, + "bugs": { + "url": "https://github.com/mauron85/react-native-background-geolocation/issues" + }, + "dependencies": { + "plist": "^3.0.1" + }, + "description": "optimized background location tracking", + "homepage": "https://github.com/mauron85/react-native-background-geolocation#readme", "keywords": [ "gps", "geolocation", @@ -26,16 +52,27 @@ "android", "ios" ], - "author": "Marian Hello", "license": "Apache-2.0", - "bugs": { - "url": "https://github.com/mauron85/react-native-background-geolocation/issues" - }, - "homepage": "https://github.com/mauron85/react-native-background-geolocation#readme", - "dependencies": { - "plist": "^3.0.1" - }, + "main": "./index.js", + "maintainers": [ + { + "name": "Darron Park", + "email": "mauron85@gmail.com" + } + ], + "name": "@mauron85/react-native-background-geolocation", "peerDependencies": { "react-native": ">=0.60.5" - } + }, + "repository": { + "type": "git", + "url": "git+https://github.com/mauron85/react-native-background-geolocation.git" + }, + "scripts": { + "link": "@mauron85/react-native-background-geolocation/scripts/postlink.js", + "test": "echo \"Error: no test specified\" && exit 1", + "unlink": "@mauron85/react-native-background-geolocation/scripts/postunlink.js" + }, + "types": "./index.d.ts", + "version": "0.6.6" } diff --git a/react-native.config.js b/react-native.config.js index 34f3aba7..00ee108c 100644 --- a/react-native.config.js +++ b/react-native.config.js @@ -10,4 +10,4 @@ module.exports = { postunlink: "node ./node_modules/@mauron85/react-native-background-geolocation/scripts/postunlink.js" } } -}; \ No newline at end of file +};