react-native-background-geolocation 4.6.0 → 4.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/android/build.gradle +10 -1
  3. package/android/libs/com/transistorsoft/tslocationmanager/{3.1.40/tslocationmanager-3.1.40.aar → 3.2.0/tslocationmanager-3.2.0.aar} +0 -0
  4. package/android/libs/com/transistorsoft/tslocationmanager/3.2.0/tslocationmanager-3.2.0.aar.md5 +1 -0
  5. package/android/libs/com/transistorsoft/tslocationmanager/3.2.0/tslocationmanager-3.2.0.aar.sha1 +1 -0
  6. package/android/libs/com/transistorsoft/tslocationmanager/3.2.0/tslocationmanager-3.2.0.aar.sha256 +1 -0
  7. package/android/libs/com/transistorsoft/tslocationmanager/3.2.0/tslocationmanager-3.2.0.aar.sha512 +1 -0
  8. package/android/libs/com/transistorsoft/tslocationmanager/{3.1.40/tslocationmanager-3.1.40.pom → 3.2.0/tslocationmanager-3.2.0.pom} +1 -1
  9. package/android/libs/com/transistorsoft/tslocationmanager/3.2.0/tslocationmanager-3.2.0.pom.md5 +1 -0
  10. package/android/libs/com/transistorsoft/tslocationmanager/3.2.0/tslocationmanager-3.2.0.pom.sha1 +1 -0
  11. package/android/libs/com/transistorsoft/tslocationmanager/3.2.0/tslocationmanager-3.2.0.pom.sha256 +1 -0
  12. package/android/libs/com/transistorsoft/tslocationmanager/3.2.0/tslocationmanager-3.2.0.pom.sha512 +1 -0
  13. package/android/libs/com/transistorsoft/tslocationmanager/maven-metadata.xml +5 -9
  14. package/android/libs/com/transistorsoft/tslocationmanager-reverse/{3.1.40/tslocationmanager-reverse-3.1.40.aar → 3.2.0/tslocationmanager-reverse-3.2.0.aar} +0 -0
  15. package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.2.0/tslocationmanager-reverse-3.2.0.aar.md5 +1 -0
  16. package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.2.0/tslocationmanager-reverse-3.2.0.aar.sha1 +1 -0
  17. package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.2.0/tslocationmanager-reverse-3.2.0.aar.sha256 +1 -0
  18. package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.2.0/tslocationmanager-reverse-3.2.0.aar.sha512 +1 -0
  19. package/android/libs/com/transistorsoft/tslocationmanager-reverse/{3.1.40/tslocationmanager-reverse-3.1.40.pom → 3.2.0/tslocationmanager-reverse-3.2.0.pom} +1 -1
  20. package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.2.0/tslocationmanager-reverse-3.2.0.pom.md5 +1 -0
  21. package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.2.0/tslocationmanager-reverse-3.2.0.pom.sha1 +1 -0
  22. package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.2.0/tslocationmanager-reverse-3.2.0.pom.sha256 +1 -0
  23. package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.2.0/tslocationmanager-reverse-3.2.0.pom.sha512 +1 -0
  24. package/android/libs/com/transistorsoft/tslocationmanager-reverse/maven-metadata.xml +5 -9
  25. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/Info.plist +9 -9
  26. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/TSLocation.h +2 -0
  27. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Info.plist +0 -0
  28. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/TSLocationManager +0 -0
  29. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/TSLocation.h +2 -0
  30. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Info.plist +0 -0
  31. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/TSLocationManager +0 -0
  32. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/_CodeSignature/CodeDirectory +0 -0
  33. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/_CodeSignature/CodeRequirements-1 +0 -0
  34. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/_CodeSignature/CodeResources +4 -4
  35. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSLocation.h +2 -0
  36. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Resources/Info.plist +4 -4
  37. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/TSLocationManager +0 -0
  38. package/package.json +2 -14
  39. package/src/declarations/types.d.ts +1 -0
  40. package/android/libs/com/transistorsoft/tslocationmanager/3.1.40/tslocationmanager-3.1.40.aar.md5 +0 -1
  41. package/android/libs/com/transistorsoft/tslocationmanager/3.1.40/tslocationmanager-3.1.40.aar.sha1 +0 -1
  42. package/android/libs/com/transistorsoft/tslocationmanager/3.1.40/tslocationmanager-3.1.40.aar.sha256 +0 -1
  43. package/android/libs/com/transistorsoft/tslocationmanager/3.1.40/tslocationmanager-3.1.40.aar.sha512 +0 -1
  44. package/android/libs/com/transistorsoft/tslocationmanager/3.1.40/tslocationmanager-3.1.40.pom.md5 +0 -1
  45. package/android/libs/com/transistorsoft/tslocationmanager/3.1.40/tslocationmanager-3.1.40.pom.sha1 +0 -1
  46. package/android/libs/com/transistorsoft/tslocationmanager/3.1.40/tslocationmanager-3.1.40.pom.sha256 +0 -1
  47. package/android/libs/com/transistorsoft/tslocationmanager/3.1.40/tslocationmanager-3.1.40.pom.sha512 +0 -1
  48. package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.40/tslocationmanager-reverse-3.1.40.aar.md5 +0 -1
  49. package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.40/tslocationmanager-reverse-3.1.40.aar.sha1 +0 -1
  50. package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.40/tslocationmanager-reverse-3.1.40.aar.sha256 +0 -1
  51. package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.40/tslocationmanager-reverse-3.1.40.aar.sha512 +0 -1
  52. package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.40/tslocationmanager-reverse-3.1.40.pom.md5 +0 -1
  53. package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.40/tslocationmanager-reverse-3.1.40.pom.sha1 +0 -1
  54. package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.40/tslocationmanager-reverse-3.1.40.pom.sha256 +0 -1
  55. package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.40/tslocationmanager-reverse-3.1.40.pom.sha512 +0 -1
  56. package/react-native.config.js +0 -20
  57. package/scripts/postlink.js +0 -146
  58. package/scripts/postunlink.js +0 -128
package/CHANGELOG.md CHANGED
@@ -1,5 +1,40 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.8.1 — 2022-06-28
4
+ * Fix issue for react-native 0.69: They made a breaking change with the old, unused react-native.config.js, causing builds to fail. Simply delete the file `react-native.config.js`.
5
+
6
+ ## 4.8.0 — 2022-06-21
7
+ * [Android] Fix bug in `onProviderChange` event: not properly detecting when location-services disabled.
8
+ * [Android] __Android 12__: Guard `Context.startForegroundService` with `try / catch`: the plugin will now catch exception `ForegroundServiceStartNotAllowedException` and automatically retry with an `AlarmManager` *oneShot* event.
9
+ * [Android] __Android 12__: Refactor foreground-service management for Android 12: A way has been found to restore the traditional behaviour of foreground-services, allowing them to stop when no longer required (eg: where the plugin is in the stationary state).
10
+ * [Android] Refactor application life-cycle management. Remove deprecated permission `android.permission.GET_TASKS` traditionally used for detecting when the app has been terminated. The new life-cycle mgmt system can detect Android headless-mode in a much more elegant manner.
11
+ * [Android] Better handling for `WhenInUse` behaviour: The plugin will not allow `.changePace(true)` to be executed when the app is in the background (since Android forbids location-services to initiated in the background with `WhenInUse`).
12
+ * [Android] Refactor `useSignificantChangesOnly` behaviour. Will use a default `motionTriggerDelay` with minimum 60000ms, minimum `distanceFilter: 250` and enforced `stopTimeout: 20`.
13
+ * [iOS] iOS 15 has finally implemented *Mock Location Detection*. `location.mock` will now be present for iOS when the location is mocked, just like Android.
14
+
15
+ ## 4.7.2 — Unreleased
16
+ * [Android] Re-factor onProviderChange. Add broadcast-receiver for `AIRPLANE_MODE` detection.
17
+ * [Android] Add guard against Android 12 issue where location-services fail to turn off after terminate and plugin enters stationary state.
18
+ * [Android] Prevent recording motionchange position from running after onProviderChange.
19
+ * [Android] Fix bug in Android 12 support for executing `.start()` in background while terminated. Used `JobScheduler` ONESHOT instead of `AlarmManager`.
20
+ * [Android] Plugin could be placed into an infinite loop requesting motionchange position in some cases.
21
+ * [Android] Address `ConcurrentModificationException` in `onPermissionGranted`.
22
+
23
+ ## 4.7.1 — 2022-05-12
24
+ * [Android] If on device reboot location-services fails to provide a location (eg: timeout, airplane mode), the plugin would rely on motion API events to try again. This is a problem if the motion api is disabled. Instead, the SDK will keep trying to retrieve a location.
25
+ * [Android] Android 12 support for `ForegroundServiceStartNotAllowedException`: immediately launch the SDK's `TrackingService` as soon as `.start()` executes. If a location-timeout occurs while fetching the onMotionChange position after device reboot with `startOnBoot: true`, the `ForegroundServiceStartNotAllowedException` could be raised.
26
+ * [Android] Add two new attributes `android:enabled` and `android:permission` to the SDK's built-in `BootReceiver`:
27
+ ```xml
28
+ <receiver android:name="com.transistorsoft.locationmanager.BootReceiver" android:enabled="true" android:exported="false" android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
29
+ ```
30
+ * [Android] Android 12 support for executing `.start()` and `.getCurrentPosition()` while the plugin is disabled and in the background. This is a bypass of new Android 12 restrictions for starting foreground-services in the background by taking advantage of AlarmManager.
31
+ ```
32
+ Fatal Exception: android.app.ForegroundServiceStartNotAllowedException: startForegroundService() not allowed due to mAllowStartForeground false: service
33
+ ```
34
+ * [Android] Added two new `androidx.lifecycle` dependencies to plugin's `build.gradle`, in addition to corresponding `ext` vars `ext.lifeCycleRunTimeVersion` and `ext.lifeCycleRuntimeVersion`
35
+ - `"androidx.lifecycle:lifecycle-runtime"`
36
+ - `"androidx.lifecycle:lifecycle-extensions"`
37
+
3
38
  ## 4.6.0 &mdash; 2022-04-29
4
39
  * [Android] Add a few extra manufacturer-specific `Intent` for `DeviceSettings.showPowerManager()`.
5
40
  * [Android] Minimum `compileSdkVersion 31` is now required.
@@ -11,6 +11,8 @@ def DEFAULT_OK_HTTP_VERSION = "3.12.13"
11
11
  def DEFAULT_ANDROID_PERMISSIONS_VERSION = "2.1.6"
12
12
  def DEFAULT_EVENTBUS_VERSION = "3.3.1"
13
13
  def DEFAULT_LOCAL_BROADCAST_MANAGER_VERSION = "1.0.0"
14
+ def DEFAULT_LIFE_CYCLE_RUNTIME_VERSION = "2.4.1"
15
+ def DEFAULT_LIFE_CYCLE_EXTENSIONS_VERSION = "2.2.0"
14
16
 
15
17
  def useAndroidX = (project.hasProperty("android.useAndroidX")) ? project.property("android.useAndroidX") : false
16
18
 
@@ -43,6 +45,9 @@ dependencies {
43
45
  def androidPermissionsVersion = safeExtGet('androidPermissionsVersion', DEFAULT_ANDROID_PERMISSIONS_VERSION)
44
46
  def eventBusVersion = safeExtGet('eventBusVersion', DEFAULT_EVENTBUS_VERSION)
45
47
  def localBroadcastManagerVersion = safeExtGet('localBroadcastManagerVersion', DEFAULT_LOCAL_BROADCAST_MANAGER_VERSION)
48
+ def lifeCycleRuntimeVersion = safeExtGet('lifeCycleRuntimeVersion', DEFAULT_LIFE_CYCLE_RUNTIME_VERSION)
49
+ def lifeCycleExtensionsVersion = safeExtGet('lifeCycleExtensionsVersion', DEFAULT_LIFE_CYCLE_EXTENSIONS_VERSION)
50
+
46
51
  implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
47
52
  // tslocationmanager.aar
48
53
  if (useAndroidX) {
@@ -51,7 +56,7 @@ dependencies {
51
56
  } else {
52
57
  api(group: 'com.transistorsoft', name:'tslocationmanager-reverse', version: '+')
53
58
  }
54
-
59
+
55
60
  implementation "androidx.appcompat:appcompat:$appCompatVersion"
56
61
  implementation "com.google.android.gms:play-services-location:$playServicesLocationVersion"
57
62
  implementation "org.greenrobot:eventbus:$eventBusVersion"
@@ -59,4 +64,8 @@ dependencies {
59
64
  implementation 'org.slf4j:slf4j-api:1.7.25'
60
65
  implementation 'com.github.tony19:logback-android:2.0.0'
61
66
  implementation "io.github.nishkarsh:android-permissions:$androidPermissionsVersion"
67
+ // LifeCycleObserver
68
+ implementation "androidx.lifecycle:lifecycle-runtime:$lifeCycleRuntimeVersion"
69
+ implementation "androidx.lifecycle:lifecycle-extensions:$lifeCycleExtensionsVersion"
70
+
62
71
  }
@@ -0,0 +1 @@
1
+ ed830184db07958882c6a45e0bd161d3579e76e6
@@ -0,0 +1 @@
1
+ ab123be2746cde234d73d5bcb7ba43d0244863f6793b998957719d2453d29041
@@ -0,0 +1 @@
1
+ 22637965b65d2be0b58c399b22253c1d7e4e5686f44a4feca0530256ae04ea18743352ba052d3244494a3222bd7a8334bc9b1ba9004c5e0fcc776899d435800c
@@ -4,6 +4,6 @@
4
4
  <modelVersion>4.0.0</modelVersion>
5
5
  <groupId>com.transistorsoft</groupId>
6
6
  <artifactId>tslocationmanager</artifactId>
7
- <version>3.1.40</version>
7
+ <version>3.2.0</version>
8
8
  <packaging>aar</packaging>
9
9
  </project>
@@ -0,0 +1 @@
1
+ 40d54ed521787422446dc06afba5a02762f27740
@@ -0,0 +1 @@
1
+ f986e9fe5e8ecbd9023de7ee2f89f8a483a851397c289c247b666e120d3928ce
@@ -0,0 +1 @@
1
+ 435bf38ae8aff418f334d16f542aea0dc340919d8bcc066b622a011b274d08471377023c4c7194d8a58cfa5bce564ace1d0d6ad8adb2b7e3772778a76596f369
@@ -3,16 +3,12 @@
3
3
  <groupId>com.transistorsoft</groupId>
4
4
  <artifactId>tslocationmanager</artifactId>
5
5
  <versioning>
6
- <latest>3.1.40</latest>
7
- <release>3.1.40</release>
6
+ <latest>3.2.0</latest>
7
+ <release>3.2.0</release>
8
8
  <versions>
9
- <version>3.1.35</version>
10
- <version>3.1.36</version>
11
- <version>3.1.37</version>
12
- <version>3.1.38</version>
13
- <version>3.1.39</version>
14
- <version>3.1.40</version>
9
+ <version>3.1.46</version>
10
+ <version>3.2.0</version>
15
11
  </versions>
16
- <lastUpdated>20220422152858</lastUpdated>
12
+ <lastUpdated>20220620224941</lastUpdated>
17
13
  </versioning>
18
14
  </metadata>
@@ -0,0 +1 @@
1
+ b0d0def4b4d88b5d2b840aaeb487e4a67d9235e3d5aa1a98f36ca2c38c585c1d
@@ -0,0 +1 @@
1
+ 145fc2ec5847a3b22f607a5ba75fae4d2d026d712d9fc36477d035b44907d10b35c3a694fbbea07ef3c77b1fc3189cd572306bf2df526f470d083471d379f8b5
@@ -4,6 +4,6 @@
4
4
  <modelVersion>4.0.0</modelVersion>
5
5
  <groupId>com.transistorsoft</groupId>
6
6
  <artifactId>tslocationmanager-reverse</artifactId>
7
- <version>3.1.40</version>
7
+ <version>3.2.0</version>
8
8
  <packaging>aar</packaging>
9
9
  </project>
@@ -0,0 +1 @@
1
+ 666f560bd1849f11b898391e7939550d76f3e47608597c2ce0ded18e9fd54040
@@ -0,0 +1 @@
1
+ ed9e8f7943ad1fb6c1e5eb4ecce9fa5c01c27081fbae3beada0797eb59bc0e1ee54c5ecfddfa80ac99d500a55c4dbc7d3590696ae45d809e11f3f0c6863fc25d
@@ -3,16 +3,12 @@
3
3
  <groupId>com.transistorsoft</groupId>
4
4
  <artifactId>tslocationmanager-reverse</artifactId>
5
5
  <versioning>
6
- <latest>3.1.40</latest>
7
- <release>3.1.40</release>
6
+ <latest>3.2.0</latest>
7
+ <release>3.2.0</release>
8
8
  <versions>
9
- <version>3.1.35</version>
10
- <version>3.1.36</version>
11
- <version>3.1.37</version>
12
- <version>3.1.38</version>
13
- <version>3.1.39</version>
14
- <version>3.1.40</version>
9
+ <version>3.1.46</version>
10
+ <version>3.2.0</version>
15
11
  </versions>
16
- <lastUpdated>20220422152858</lastUpdated>
12
+ <lastUpdated>20220620224941</lastUpdated>
17
13
  </versioning>
18
14
  </metadata>
@@ -6,47 +6,47 @@
6
6
  <array>
7
7
  <dict>
8
8
  <key>LibraryIdentifier</key>
9
- <string>ios-arm64_x86_64-maccatalyst</string>
9
+ <string>ios-arm64_i386_x86_64-simulator</string>
10
10
  <key>LibraryPath</key>
11
11
  <string>TSLocationManager.framework</string>
12
12
  <key>SupportedArchitectures</key>
13
13
  <array>
14
14
  <string>arm64</string>
15
+ <string>i386</string>
15
16
  <string>x86_64</string>
16
17
  </array>
17
18
  <key>SupportedPlatform</key>
18
19
  <string>ios</string>
19
20
  <key>SupportedPlatformVariant</key>
20
- <string>maccatalyst</string>
21
+ <string>simulator</string>
21
22
  </dict>
22
23
  <dict>
23
24
  <key>LibraryIdentifier</key>
24
- <string>ios-arm64_i386_x86_64-simulator</string>
25
+ <string>ios-arm64_armv7</string>
25
26
  <key>LibraryPath</key>
26
27
  <string>TSLocationManager.framework</string>
27
28
  <key>SupportedArchitectures</key>
28
29
  <array>
29
30
  <string>arm64</string>
30
- <string>i386</string>
31
- <string>x86_64</string>
31
+ <string>armv7</string>
32
32
  </array>
33
33
  <key>SupportedPlatform</key>
34
34
  <string>ios</string>
35
- <key>SupportedPlatformVariant</key>
36
- <string>simulator</string>
37
35
  </dict>
38
36
  <dict>
39
37
  <key>LibraryIdentifier</key>
40
- <string>ios-arm64_armv7</string>
38
+ <string>ios-arm64_x86_64-maccatalyst</string>
41
39
  <key>LibraryPath</key>
42
40
  <string>TSLocationManager.framework</string>
43
41
  <key>SupportedArchitectures</key>
44
42
  <array>
45
43
  <string>arm64</string>
46
- <string>armv7</string>
44
+ <string>x86_64</string>
47
45
  </array>
48
46
  <key>SupportedPlatform</key>
49
47
  <string>ios</string>
48
+ <key>SupportedPlatformVariant</key>
49
+ <string>maccatalyst</string>
50
50
  </dict>
51
51
  </array>
52
52
  <key>CFBundlePackageType</key>
@@ -72,6 +72,8 @@ typedef enum tsLocationType : NSInteger {
72
72
  * to the plugin's database, nor are they posted to your configured #url
73
73
  */
74
74
  @property (nonatomic, readonly) BOOL isSample;
75
+
76
+ @property (nonatomic, readonly) BOOL mock;
75
77
  /**
76
78
  * YES when this location was provided to a heartbeat event
77
79
  */
@@ -72,6 +72,8 @@ typedef enum tsLocationType : NSInteger {
72
72
  * to the plugin's database, nor are they posted to your configured #url
73
73
  */
74
74
  @property (nonatomic, readonly) BOOL isSample;
75
+
76
+ @property (nonatomic, readonly) BOOL mock;
75
77
  /**
76
78
  * YES when this location was provided to a heartbeat event
77
79
  */
@@ -102,7 +102,7 @@
102
102
  </data>
103
103
  <key>Headers/TSLocation.h</key>
104
104
  <data>
105
- ZOhXybXZGss84kW1u83mEd3w49o=
105
+ 1mg7Br/BpsMYtl9RvmFgPHnnysI=
106
106
  </data>
107
107
  <key>Headers/TSLocationManager.h</key>
108
108
  <data>
@@ -138,7 +138,7 @@
138
138
  </data>
139
139
  <key>Info.plist</key>
140
140
  <data>
141
- 2fwUhP/XxcH3Zc7lGewfTh2dvI4=
141
+ YDZTb0oJE3fq+OMxysmlktNu66E=
142
142
  </data>
143
143
  <key>Modules/module.modulemap</key>
144
144
  <data>
@@ -415,11 +415,11 @@
415
415
  <dict>
416
416
  <key>hash</key>
417
417
  <data>
418
- ZOhXybXZGss84kW1u83mEd3w49o=
418
+ 1mg7Br/BpsMYtl9RvmFgPHnnysI=
419
419
  </data>
420
420
  <key>hash2</key>
421
421
  <data>
422
- TSvnvdnSzHeA3LKw8qJMQJR/HBmlgLQ+446VE9u1atk=
422
+ FTWiNKgNFY9FMbZbJc/dKCyrfir0MadGghuUTPFStXU=
423
423
  </data>
424
424
  </dict>
425
425
  <key>Headers/TSLocationManager.h</key>
@@ -72,6 +72,8 @@ typedef enum tsLocationType : NSInteger {
72
72
  * to the plugin's database, nor are they posted to your configured #url
73
73
  */
74
74
  @property (nonatomic, readonly) BOOL isSample;
75
+
76
+ @property (nonatomic, readonly) BOOL mock;
75
77
  /**
76
78
  * YES when this location was provided to a heartbeat event
77
79
  */
@@ -3,7 +3,7 @@
3
3
  <plist version="1.0">
4
4
  <dict>
5
5
  <key>BuildMachineOSBuild</key>
6
- <string>21E230</string>
6
+ <string>21E258</string>
7
7
  <key>CFBundleDevelopmentRegion</key>
8
8
  <string>en</string>
9
9
  <key>CFBundleExecutable</key>
@@ -27,7 +27,7 @@
27
27
  <key>DTCompiler</key>
28
28
  <string>com.apple.compilers.llvm.clang.1_0</string>
29
29
  <key>DTPlatformBuild</key>
30
- <string>13E113</string>
30
+ <string>13E500a</string>
31
31
  <key>DTPlatformName</key>
32
32
  <string>macosx</string>
33
33
  <key>DTPlatformVersion</key>
@@ -37,9 +37,9 @@
37
37
  <key>DTSDKName</key>
38
38
  <string>macosx12.3</string>
39
39
  <key>DTXcode</key>
40
- <string>1330</string>
40
+ <string>1331</string>
41
41
  <key>DTXcodeBuild</key>
42
- <string>13E113</string>
42
+ <string>13E500a</string>
43
43
  <key>LSMinimumSystemVersion</key>
44
44
  <string>10.15</string>
45
45
  <key>UIDeviceFamily</key>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-background-geolocation",
3
- "version": "4.6.0",
3
+ "version": "4.8.1",
4
4
  "description": "The most sophisticated cross-platform background location-tracking & geofencing module with battery-conscious motion-detection intelligence",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -26,24 +26,12 @@
26
26
  "bugs": {
27
27
  "url": "https://github.com/transistorsoft/react-native-background-geolocation/issues"
28
28
  },
29
- "rnpm": {
30
- "commands": {
31
- "postlink": "node node_modules/react-native-background-geolocation/scripts/postlink.js",
32
- "postunlink": "node node_modules/react-native-background-geolocation/scripts/postunlink.js"
33
- },
34
- "ios": {
35
- "sharedLibraries": [
36
- "libsqlite3",
37
- "libz"
38
- ]
39
- }
40
- },
41
29
  "homepage": "https://www.transistorsoft.com/shop/products/react-native-background-geolocation",
42
30
  "peerDependencies": {
43
31
  "react-native": ">=0.36.0"
44
32
  },
45
33
  "dependencies": {
46
- "react-native-background-fetch": "~4.1.0"
34
+ "react-native-background-fetch": "~4.1.1"
47
35
  },
48
36
  "devDependencies": {
49
37
  "@transistorsoft/typedoc-theme": "^2.0.8",
@@ -137,6 +137,7 @@ declare module "react-native-background-geolocation" {
137
137
  * | 0 | Location unknown |
138
138
  * | 1 | Location permission denied |
139
139
  * | 2 | Network error |
140
+ * | 3 | Attempt to initiate location-services in background with WhenInUse authorization |
140
141
  * | 408 | Location timeout |
141
142
  * | 499 | Location request cancelled |
142
143
  */
@@ -1 +0,0 @@
1
- 7392501e399c169cf87c3d3b557b70431c59660e
@@ -1 +0,0 @@
1
- e1af42d3cfbcc67ae5353f2b5cd825e0fdad04eeb9a0eac221da37640b521a12
@@ -1 +0,0 @@
1
- 2ab9e3645347497e20d74698532f154b8a71619d084516850f3367f5b39f85524930bde04e6082d445edfb385ad16943f3a6d9047a96ae44933edd6bda8e70e6
@@ -1 +0,0 @@
1
- 93ab35ca742fe32377d5555828b7bb21dd53470a
@@ -1 +0,0 @@
1
- c8ed9ea84751289922eaa05a65adb43b963e82f7c6fa0fdebdd7a96c1e07278f
@@ -1 +0,0 @@
1
- 7df3d69bf0ed9bfe4f1344fc00a0d3baad4a1b2e2c6c8f4186fa30c79ca9e8c548702763a54a4a1019869ad377d95754c18eff218e9afd99d1a5df7b277d31d9
@@ -1 +0,0 @@
1
- 527eab7324e8327c0d2b6d634ae92b1c6d51dc047fd985e855b19c9f51395f05
@@ -1 +0,0 @@
1
- ab1f3a63a720dda89911014f92e0f8fffdc728db0173eab26450be8ee9a8c36dd503e08ff2b4c88cbc03baecd072da6208789cdd676a46223cc8ea0721070168
@@ -1 +0,0 @@
1
- aa2a5d4a0c34e92cf5830e2719106758ae396b82e24fb2527f8ba363b578a718
@@ -1 +0,0 @@
1
- ab2b350105b16aad4cc4f42d04018429a9a50a9f6b625e87a943ce11ad89da98df6fd52ab74d21b6e6c90d64f1fee7020f2c76d6e7b4c3baadacb64600bd7e7f
@@ -1,20 +0,0 @@
1
- module.exports = {
2
- // config for a library is scoped under "dependency" key
3
- dependency: {
4
- platforms: {
5
- ios: {
6
- "sharedLibraries": [
7
- "libsqlite3",
8
- "libz"
9
- ]
10
- },
11
- android: {}, // projects are grouped into "platforms"
12
- },
13
- assets: [], // stays the same
14
- // hooks are considered anti-pattern, please avoid them
15
- hooks: {
16
- "postlink": "node node_modules/react-native-background-geolocation/scripts/postlink.js",
17
- "postunlink": "node node_modules/react-native-background-geolocation/scripts/postunlink.js"
18
- },
19
- },
20
- };
@@ -1,146 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const path = require('path');
4
- const fs = require('fs');
5
- const xcode = require('xcode');
6
- const PbxFile = require('xcode/lib/pbxFile');
7
- const helpers = require('./xcode-helpers');
8
-
9
- const projectDirectory = process.cwd();
10
- const moduleDirectory = path.resolve(__dirname, '..');
11
-
12
- ////
13
- // iOS
14
- //
15
- const sourceDirectory = path.join(projectDirectory, 'ios');
16
- const xcodeProjectDirectory = helpers.findProject(sourceDirectory);
17
-
18
- const projectConfig = {
19
- sourceDir: sourceDirectory,
20
- pbxprojPath: path.join(
21
- projectDirectory,
22
- 'ios',
23
- xcodeProjectDirectory,
24
- 'project.pbxproj'
25
- ),
26
- };
27
-
28
- const pathToFramework = path.relative(
29
- projectConfig.sourceDir,
30
- path.join(
31
- moduleDirectory,
32
- 'ios',
33
- 'RNBackgroundGeolocation',
34
- 'TSLocationManager.framework'
35
- )
36
- );
37
-
38
-
39
- const project = xcode.project(projectConfig.pbxprojPath).parseSync();
40
-
41
- /**
42
- * There is a method in node-xcode that offers similar functionality than what
43
- * is implemented below `addFramework` (https://github.com/alunny/node-xcode/blob/ffb938b/lib/pbxProject.js#L300)
44
- * but unfortunately it won't work for our use-case because there are two other
45
- * methods in node-xcode that are being used by `addFramework` that don't work
46
- * as expected:
47
- * 1 `addToFrameworksPbxGroup` fails if no group with the name "Frameworks" exists
48
- * https://github.com/alunny/node-xcode/blob/ffb938b/lib/pbxProject.js#L641
49
- * - https://github.com/alunny/node-xcode/issues/43
50
- * - this issue could be worked around by just checking if the group exists and
51
- * creating it if it doesn't exist before executing `addFramework`
52
- * 2 `addToFrameworkSearchPaths` doesn't work with react-native:
53
- * https://github.com/alunny/node-xcode/blob/ffb938b/lib/pbxProject.js#L1125
54
- * - https://github.com/alunny/node-xcode/issues/91
55
- * - https://github.com/alunny/node-xcode/pull/99
56
- * - the issue there is that https://github.com/alunny/node-xcode/blob/ffb938b/lib/pbxProject.js#L1133
57
- * in react-native projects the "PRODUCT_NAME" is "$(TARGET_NAME)", so it won't
58
- * be visited by this method.
59
- * And even if the name would be correct it still wouldn't work correctly for
60
- * react-native projects, because not all targets should get the library added
61
- * for example: react-native creates *tests and *tvOs and *tvOstests targets.
62
- */
63
- const file = new PbxFile(pathToFramework);
64
- file.uuid = project.generateUuid();
65
- file.fileRef = project.generateUuid();
66
- file.path = pathToFramework;
67
- file.target = project.getFirstTarget().uuid;
68
-
69
- if (!project.hasFile(file.path)) {
70
- project.addToPbxBuildFileSection(file);
71
- project.addToPbxFileReferenceSection(file);
72
- // addToFrameworksPbxGroup crashes when it can't find a group named "Frameworks"
73
- if (!project.pbxGroupByName('Frameworks')) {
74
- project.addPbxGroup([], 'Frameworks');
75
- }
76
- project.addToFrameworksPbxGroup(file);
77
- project.addToPbxFrameworksBuildPhase(file);
78
- }
79
-
80
- // Is this a Cocoapods installation?
81
- const podFile = path.join(sourceDirectory, 'Podfile');
82
- const hasPodfile = fs.existsSync(podFile);
83
- if (!hasPodfile) {
84
- // Only add FRAMEWORK_SEARCH_PATHS for non-Cocoapod installation
85
- helpers.addToFrameworkSearchPaths(
86
- project,
87
- '$(PROJECT_DIR)/' +
88
- path.relative(
89
- projectConfig.sourceDir,
90
- path.join(moduleDirectory, 'ios')
91
- ),
92
- true
93
- );
94
- } else {
95
- helpers.addToFrameworkSearchPaths(
96
- project,
97
- '$(inherited)',
98
- false
99
- );
100
- }
101
-
102
-
103
- // enable BackgroundModes in xcode project without overriding any previously
104
- // defined values in the project file.
105
- // That's why we deep clone all previously defined target attributes and extend
106
- // them with our target attributes.
107
- const targetAttributes = helpers.getTargetAttributes(project);
108
- const systemCapabilities = Object.assign({}, (targetAttributes.SystemCapabilities || {}), {
109
- 'com.apple.BackgroundModes': Object.assign(
110
- {},
111
- targetAttributes['com.apple.BackgroundModes'] || {},
112
- { enabled: true }
113
- ),
114
- });
115
- if (targetAttributes.SystemCapabilities) {
116
- targetAttributes.SystemCapabilities = systemCapabilities;
117
- } else {
118
- project.addTargetAttribute('SystemCapabilities', systemCapabilities);
119
- }
120
-
121
- // add "location" background mode to Info.plist file
122
- const plist = helpers.readPlist(projectConfig.sourceDir, project);
123
- const UIBackgroundModes = plist.UIBackgroundModes || [];
124
- if (UIBackgroundModes.indexOf('location') === -1) {
125
- plist.UIBackgroundModes = UIBackgroundModes.concat('location');
126
- }
127
-
128
- // Add NSLocationAlwaysUsageDescription
129
- if (!plist.NSLocationAlwaysUsageDescription) {
130
- plist.NSLocationAlwaysUsageDescription = "CHANGEME: Location Always Usage Description";
131
- }
132
-
133
- // Add NSLocationAlwaysAndWhenInUseUsageDescription
134
- if (!plist.NSLocationAlwaysAndWhenInUseUsageDescription) {
135
- plist.NSLocationAlwaysAndWhenInUseUsageDescription = "CHANGEME: Location Always And When In Use Usage Description";
136
- }
137
-
138
- // Add NSMotionUsageDescription
139
- if (!plist.NSMotionUsageDescription) {
140
- plist.NSMotionUsageDescription = "CHANGEME: Motion updates increase battery efficiency by intelligently toggling location-services when device is detected to be moving";
141
- }
142
-
143
- helpers.writePlist(projectConfig.sourceDir, project, plist);
144
- fs.writeFileSync(projectConfig.pbxprojPath, project.writeSync());
145
-
146
-
@@ -1,128 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const path = require('path');
4
- const fs = require('fs');
5
- const xcode = require('xcode');
6
- const PbxFile = require('xcode/lib/pbxFile');
7
- const helpers = require('./xcode-helpers');
8
-
9
- const projectDirectory = process.cwd();
10
- const moduleDirectory = path.resolve(__dirname, '..');
11
- const sourceDirectory = path.join(projectDirectory, 'ios');
12
- const xcodeProjectDirectory = helpers.findProject(sourceDirectory);
13
-
14
- const projectConfig = {
15
- sourceDir: sourceDirectory,
16
- pbxprojPath: path.join(
17
- projectDirectory,
18
- 'ios',
19
- xcodeProjectDirectory,
20
- 'project.pbxproj'
21
- ),
22
- };
23
-
24
- const pathToFramework = path.relative(
25
- projectConfig.sourceDir,
26
- path.join(
27
- moduleDirectory,
28
- 'ios',
29
- 'RNBackgroundGeolocation',
30
- 'TSLocationManager.framework'
31
- )
32
- );
33
-
34
- const project = xcode.project(projectConfig.pbxprojPath).parseSync();
35
-
36
- const file = new PbxFile(pathToFramework);
37
- file.target = project.getFirstTarget().uuid;
38
-
39
- project.removeFromPbxBuildFileSection(file);
40
- project.removeFromPbxFileReferenceSection(file);
41
- if (project.pbxGroupByName('Frameworks')) {
42
- project.removeFromFrameworksPbxGroup(file);
43
- }
44
- project.removeFromPbxFrameworksBuildPhase(file);
45
-
46
- // Is this a Cocoapods installation?
47
- const podFile = path.join(sourceDirectory, 'Podfile');
48
- const hasPodfile = fs.existsSync(podFile);
49
- if (!hasPodfile) {
50
- helpers.removeFromFrameworkSearchPaths(
51
- project,
52
- '$(PROJECT_DIR)/' +
53
- path.relative(
54
- projectConfig.sourceDir,
55
- path.join(moduleDirectory, 'ios')
56
- )
57
- );
58
- }
59
-
60
- // disable BackgroundModes and remove "fetch" mode from plist file
61
- const systemCapabilities = helpers.getTargetAttributes(project).SystemCapabilities;
62
- if (systemCapabilities && systemCapabilities['com.apple.BackgroundModes']) {
63
- delete systemCapabilities['com.apple.BackgroundModes'].enabled;
64
- if (Object.keys(systemCapabilities['com.apple.BackgroundModes']).length === 0) {
65
- delete systemCapabilities['com.apple.BackgroundModes'];
66
- }
67
-
68
- if (Object.keys(systemCapabilities).length === 0) {
69
- project.removeTargetAttribute('SystemCapabilities');
70
- }
71
- }
72
-
73
- const plist = helpers.readPlist(projectConfig.sourceDir, project);
74
- if (Array.isArray(plist.UIBackgroundModes)) {
75
- plist.UIBackgroundModes = plist.UIBackgroundModes.filter(
76
- mode => mode !== 'location'
77
- );
78
- if (plist.UIBackgroundModes.length === 0) {
79
- delete plist.UIBackgroundModes;
80
- }
81
- }
82
-
83
- helpers.writePlist(projectConfig.sourceDir, project, plist);
84
- fs.writeFileSync(projectConfig.pbxprojPath, project.writeSync());
85
-
86
- ////
87
- // Android
88
- // - Remove maven url
89
- // maven {
90
- // url "$rootDir/../node_modules/react-native-background-geolocation/android/libs"
91
- // }
92
- //
93
- const androidSrcDir = path.join(projectDirectory, 'android');
94
- const gradleFile = path.join(androidSrcDir, 'build.gradle');
95
- const moduleName = (process.platform === 'win32') ? moduleDirectory.split('\\').pop() : moduleDirectory.split('/').pop();
96
-
97
- fs.readFile(gradleFile, 'utf8', function (err,data) {
98
- if (err) {
99
- return console.log(err);
100
- }
101
- var re = new RegExp("[\\t?\\s?]+maven\\s?\\{[\\n?\\s?\\t?]+url.*" + moduleName + "\\/.*[\\n?\\t?\\s?]+\\}", "gm");
102
-
103
- if (data.match(re)) {
104
- fs.writeFile(gradleFile, data.replace(re, ''), 'utf8', function (err) {
105
- if (err) return console.log(err);
106
- });
107
- }
108
-
109
- });
110
-
111
- // Remove method-call purgeBackgroundGeolocationDebugResources(applicationVariants)
112
- const appGradleFile = path.join(androidSrcDir, 'app', 'build.gradle');
113
- const purgeMethodName = "purgeBackgroundGeolocationDebugResources";
114
-
115
- fs.readFile(appGradleFile, 'utf8', function(err, data) {
116
- if (err) {
117
- return console.log(err);
118
- }
119
- var purgeMethodRE = new RegExp("^[\\s\\t]+" + purgeMethodName + "\\(applicationVariants\\).*$[\\s\\n]+(.*)", "gm");
120
-
121
- if (purgeMethodRE.test(data)) {
122
- data = data.replace(purgeMethodRE, '\t$1');
123
- }
124
- fs.writeFile(appGradleFile, data, 'utf8', function (err) {
125
- if (err) return console.log(err);
126
- });
127
- });
128
-