react-native-background-geolocation 4.19.2 → 5.0.0-beta.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 (192) hide show
  1. package/README.md +1 -1
  2. package/RNBackgroundGeolocation.podspec +3 -3
  3. package/android/.settings/org.eclipse.buildship.core.prefs +13 -0
  4. package/android/build.gradle +21 -56
  5. package/android/proguard-rules.pro +66 -38
  6. package/android/src/main/java/com/transistorsoft/rnbackgroundgeolocation/HeadlessTask.java +44 -44
  7. package/android/src/main/java/com/transistorsoft/rnbackgroundgeolocation/RNBackgroundGeolocation.java +1 -0
  8. package/android/src/main/java/com/transistorsoft/rnbackgroundgeolocation/RNBackgroundGeolocationModule.java +303 -274
  9. package/babel.config.js +5 -0
  10. package/expo/plugin/build/androidPlugin.js.map +1 -1
  11. package/expo/plugin/tsconfig.tsbuildinfo +1 -0
  12. package/ios/RNBackgroundGeolocation/RNBackgroundGeolocation.m +177 -162
  13. package/jest.config.js +14 -0
  14. package/mocks/react-native.js +52 -0
  15. package/package.json +24 -13
  16. package/src/DeviceSettings.js +7 -24
  17. package/src/Logger.js +4 -23
  18. package/src/NativeModule.js +61 -262
  19. package/src/{TransistorAuthorizationToken.js → TransistorAuthorizationService.js} +17 -19
  20. package/src/index.d.ts +13 -1
  21. package/src/index.js +266 -462
  22. package/src/native/specs/NativeBackgroundGeolocation.ts +49 -0
  23. package/tests/enums-bridge-test.js +16 -0
  24. package/tests/enums.test.js +23 -0
  25. package/tests/ready-compound.test.js +28 -0
  26. package/tests/ready.test.js +6 -0
  27. package/tests-types/config-surface.ts +38 -0
  28. package/tests-types/enums-smoke-test.ts +35 -0
  29. package/tests-types/events-typing.ts +23 -0
  30. package/tests-types/flat-config.ts +0 -0
  31. package/tests-types/ok.ts +20 -0
  32. package/tests-types/tsconfig.json +14 -0
  33. package/typedoc.json +49 -0
  34. package/android/libs/com/transistorsoft/tslocationmanager/3.7.0/tslocationmanager-3.7.0.aar +0 -0
  35. package/android/libs/com/transistorsoft/tslocationmanager/3.7.0/tslocationmanager-3.7.0.aar.md5 +0 -1
  36. package/android/libs/com/transistorsoft/tslocationmanager/3.7.0/tslocationmanager-3.7.0.aar.sha1 +0 -1
  37. package/android/libs/com/transistorsoft/tslocationmanager/3.7.0/tslocationmanager-3.7.0.aar.sha256 +0 -1
  38. package/android/libs/com/transistorsoft/tslocationmanager/3.7.0/tslocationmanager-3.7.0.aar.sha512 +0 -1
  39. package/android/libs/com/transistorsoft/tslocationmanager/3.7.0/tslocationmanager-3.7.0.pom +0 -9
  40. package/android/libs/com/transistorsoft/tslocationmanager/3.7.0/tslocationmanager-3.7.0.pom.md5 +0 -1
  41. package/android/libs/com/transistorsoft/tslocationmanager/3.7.0/tslocationmanager-3.7.0.pom.sha1 +0 -1
  42. package/android/libs/com/transistorsoft/tslocationmanager/3.7.0/tslocationmanager-3.7.0.pom.sha256 +0 -1
  43. package/android/libs/com/transistorsoft/tslocationmanager/3.7.0/tslocationmanager-3.7.0.pom.sha512 +0 -1
  44. package/android/libs/com/transistorsoft/tslocationmanager/maven-metadata.xml +0 -13
  45. package/android/libs/com/transistorsoft/tslocationmanager-v21/3.7.0/tslocationmanager-v21-3.7.0.aar +0 -0
  46. package/android/libs/com/transistorsoft/tslocationmanager-v21/3.7.0/tslocationmanager-v21-3.7.0.aar.md5 +0 -1
  47. package/android/libs/com/transistorsoft/tslocationmanager-v21/3.7.0/tslocationmanager-v21-3.7.0.aar.sha1 +0 -1
  48. package/android/libs/com/transistorsoft/tslocationmanager-v21/3.7.0/tslocationmanager-v21-3.7.0.aar.sha256 +0 -1
  49. package/android/libs/com/transistorsoft/tslocationmanager-v21/3.7.0/tslocationmanager-v21-3.7.0.aar.sha512 +0 -1
  50. package/android/libs/com/transistorsoft/tslocationmanager-v21/3.7.0/tslocationmanager-v21-3.7.0.pom +0 -9
  51. package/android/libs/com/transistorsoft/tslocationmanager-v21/3.7.0/tslocationmanager-v21-3.7.0.pom.md5 +0 -1
  52. package/android/libs/com/transistorsoft/tslocationmanager-v21/3.7.0/tslocationmanager-v21-3.7.0.pom.sha1 +0 -1
  53. package/android/libs/com/transistorsoft/tslocationmanager-v21/3.7.0/tslocationmanager-v21-3.7.0.pom.sha256 +0 -1
  54. package/android/libs/com/transistorsoft/tslocationmanager-v21/3.7.0/tslocationmanager-v21-3.7.0.pom.sha512 +0 -1
  55. package/android/libs/com/transistorsoft/tslocationmanager-v21/maven-metadata.xml +0 -13
  56. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/Info.plist +0 -61
  57. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/_CodeSignature/CodeDirectory +0 -0
  58. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/_CodeSignature/CodeRequirements +0 -0
  59. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/_CodeSignature/CodeRequirements-1 +0 -0
  60. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/_CodeSignature/CodeResources +0 -2033
  61. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/_CodeSignature/CodeSignature +0 -0
  62. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/AtomicBoolean.h +0 -18
  63. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/ConfigModule.h +0 -21
  64. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/HttpRequest.h +0 -21
  65. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/HttpResponse.h +0 -29
  66. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/LocationManager.h +0 -55
  67. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/LogQuery.h +0 -13
  68. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/SOMotionDetector.h +0 -141
  69. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/SQLQuery.h +0 -34
  70. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSActivityChangeEvent.h +0 -16
  71. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSAuthorization.h +0 -38
  72. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSAuthorizationEvent.h +0 -18
  73. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSCallback.h +0 -18
  74. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSConfig.h +0 -310
  75. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSConnectivityChangeEvent.h +0 -17
  76. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSCurrentPositionRequest.h +0 -43
  77. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSDeviceInfo.h +0 -24
  78. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSEnabledChangeEvent.h +0 -15
  79. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSGeofence.h +0 -54
  80. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSGeofenceEvent.h +0 -64
  81. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSGeofenceManager.h +0 -54
  82. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSGeofencesChangeEvent.h +0 -17
  83. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSHeartbeatEvent.h +0 -18
  84. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSHttpEvent.h +0 -19
  85. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSHttpService.h +0 -58
  86. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSLocation.h +0 -105
  87. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSLocationManager.h +0 -315
  88. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSPowerSaveChangeEvent.h +0 -14
  89. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSProviderChangeEvent.h +0 -20
  90. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSReachability.h +0 -106
  91. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSSchedule.h +0 -40
  92. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSScheduleEvent.h +0 -18
  93. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSWatchPositionRequest.h +0 -41
  94. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TransistorAuthorizationToken.h +0 -31
  95. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Info.plist +0 -0
  96. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Miniball/Miniball.hpp +0 -525
  97. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Modules/module.modulemap +0 -6
  98. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/PrivacyInfo.xcprivacy +0 -36
  99. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/TSLocationManager +0 -0
  100. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/_CodeSignature/CodeDirectory +0 -0
  101. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/_CodeSignature/CodeRequirements +0 -0
  102. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/_CodeSignature/CodeRequirements-1 +0 -0
  103. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/_CodeSignature/CodeResources +0 -642
  104. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/_CodeSignature/CodeSignature +0 -0
  105. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/AtomicBoolean.h +0 -18
  106. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/ConfigModule.h +0 -21
  107. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/HttpRequest.h +0 -21
  108. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/HttpResponse.h +0 -29
  109. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/LocationManager.h +0 -55
  110. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/LogQuery.h +0 -13
  111. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/SOMotionDetector.h +0 -141
  112. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/SQLQuery.h +0 -34
  113. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSActivityChangeEvent.h +0 -16
  114. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSAuthorization.h +0 -38
  115. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSAuthorizationEvent.h +0 -18
  116. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSCallback.h +0 -18
  117. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSConfig.h +0 -310
  118. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSConnectivityChangeEvent.h +0 -17
  119. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSCurrentPositionRequest.h +0 -43
  120. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSDeviceInfo.h +0 -24
  121. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSEnabledChangeEvent.h +0 -15
  122. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSGeofence.h +0 -54
  123. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSGeofenceEvent.h +0 -64
  124. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSGeofenceManager.h +0 -54
  125. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSGeofencesChangeEvent.h +0 -17
  126. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSHeartbeatEvent.h +0 -18
  127. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSHttpEvent.h +0 -19
  128. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSHttpService.h +0 -58
  129. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSLocation.h +0 -105
  130. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSLocationManager.h +0 -315
  131. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSPowerSaveChangeEvent.h +0 -14
  132. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSProviderChangeEvent.h +0 -20
  133. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSReachability.h +0 -106
  134. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSSchedule.h +0 -40
  135. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSScheduleEvent.h +0 -18
  136. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSWatchPositionRequest.h +0 -41
  137. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TransistorAuthorizationToken.h +0 -31
  138. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Modules/module.modulemap +0 -6
  139. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Resources/Info.plist +0 -50
  140. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Resources/Miniball/Miniball.hpp +0 -525
  141. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Resources/PrivacyInfo.xcprivacy +0 -36
  142. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/TSLocationManager +0 -0
  143. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/_CodeSignature/CodeDirectory +0 -0
  144. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/_CodeSignature/CodeRequirements +0 -0
  145. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/_CodeSignature/CodeRequirements-1 +0 -0
  146. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/_CodeSignature/CodeResources +0 -536
  147. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/_CodeSignature/CodeSignature +0 -0
  148. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/AtomicBoolean.h +0 -18
  149. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/ConfigModule.h +0 -21
  150. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/HttpRequest.h +0 -21
  151. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/HttpResponse.h +0 -29
  152. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/LocationManager.h +0 -55
  153. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/LogQuery.h +0 -13
  154. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/SOMotionDetector.h +0 -141
  155. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/SQLQuery.h +0 -34
  156. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSActivityChangeEvent.h +0 -16
  157. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSAuthorization.h +0 -38
  158. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSAuthorizationEvent.h +0 -18
  159. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSCallback.h +0 -18
  160. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSConfig.h +0 -310
  161. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSConnectivityChangeEvent.h +0 -17
  162. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSCurrentPositionRequest.h +0 -43
  163. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSDeviceInfo.h +0 -24
  164. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSEnabledChangeEvent.h +0 -15
  165. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSGeofence.h +0 -54
  166. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSGeofenceEvent.h +0 -64
  167. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSGeofenceManager.h +0 -54
  168. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSGeofencesChangeEvent.h +0 -17
  169. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSHeartbeatEvent.h +0 -18
  170. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSHttpEvent.h +0 -19
  171. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSHttpService.h +0 -58
  172. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSLocation.h +0 -105
  173. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSLocationManager.h +0 -315
  174. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSPowerSaveChangeEvent.h +0 -14
  175. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSProviderChangeEvent.h +0 -20
  176. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSReachability.h +0 -106
  177. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSSchedule.h +0 -40
  178. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSScheduleEvent.h +0 -18
  179. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSWatchPositionRequest.h +0 -41
  180. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TransistorAuthorizationToken.h +0 -31
  181. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Info.plist +0 -0
  182. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Miniball/Miniball.hpp +0 -525
  183. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Modules/module.modulemap +0 -6
  184. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/PrivacyInfo.xcprivacy +0 -36
  185. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/TSLocationManager +0 -0
  186. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/_CodeSignature/CodeDirectory +0 -0
  187. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/_CodeSignature/CodeRequirements +0 -0
  188. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/_CodeSignature/CodeRequirements-1 +0 -0
  189. package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/_CodeSignature/CodeResources +0 -642
  190. package/src/Events.js +0 -17
  191. package/src/declarations/BackgroundGeolocation.d.ts +0 -1683
  192. /package/{ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/_CodeSignature/CodeSignature → tests-types/api-surface.ts} +0 -0
@@ -1,1683 +0,0 @@
1
- /// <reference path="types.d.ts" />
2
- /// <reference path="interfaces/Config.d.ts" />
3
- /// <reference path="interfaces/ConnectivityChangeEvent.d.ts" />
4
- /// <reference path="interfaces/CurrentPositionRequest.d.ts" />
5
- /// <reference path="interfaces/Geofence.d.ts" />
6
- /// <reference path="interfaces/GeofenceEvent.d.ts" />
7
- /// <reference path="interfaces/GeofencesChangeEvent.d.ts" />
8
- /// <reference path="interfaces/HeartbeatEvent.d.ts" />
9
- /// <reference path="interfaces/HeadlessEvent.d.ts" />
10
- /// <reference path="interfaces/HttpEvent.d.ts" />
11
- /// <reference path="interfaces/Location.d.ts" />
12
- /// <reference path="interfaces/LocationAuthorizationAlert.d.ts" />
13
- /// <reference path="interfaces/Logger.d.ts" />
14
- /// <reference path="interfaces/MotionActivityEvent.d.ts" />
15
- /// <reference path="interfaces/MotionChangeEvent.d.ts" />
16
- /// <reference path="interfaces/ProviderChangeEvent.d.ts" />
17
- /// <reference path="interfaces/Sensors.d.ts" />
18
- /// <reference path="interfaces/State.d.ts" />
19
- /// <reference path="interfaces/WatchPositionRequest.d.ts" />
20
- /// <reference path="interfaces/DeviceSettings.d.ts" />
21
- /// <reference path="interfaces/Notification.d.ts" />
22
- /// <reference path="interfaces/SQLQuery.d.ts" />
23
- /// <reference path="interfaces/DeviceInfo.d.ts" />
24
- /// <reference path="interfaces/Authorization.d.ts" />
25
- /// <reference path="interfaces/AuthorizationEvent.d.ts" />
26
- /// <reference path="interfaces/TransistorAuthorizationToken.d.ts" />
27
- /// <reference path="interfaces/Subscription.d.ts" />
28
- declare module "react-native-background-geolocation" {
29
- /**
30
- * Primary API of the SDK.
31
- * @break
32
- *
33
- * ## 📚 Help
34
- * - 📘 [Philosophy of Operation](github:wiki/Philosophy-of-Operation)
35
- * - 📘 [[HttpEvent | HTTP Guide]].
36
- * - 📘 [[Geofence | Geofencing Guide]].
37
- * - 📘 [Android Headless Mode](github:wiki/Android-Headless-Mode).
38
- * - 📘 [Debugging Guide](github:wiki/Debugging).
39
- *
40
- * ## ⚡️ Events
41
- *
42
- * [[BackgroundGeolocation]] is event-based. Interacting with the SDK is largely through implementing listeners on the following events:
43
- *
44
- * | Method | Description |
45
- * |------------------------|-----------------------------------------|
46
- * | [[onLocation]] | Fired with each recorded [[Location]] |
47
- * | [[onMotionChange]] | Fired when the plugin changes state between *moving* / *stationary* |
48
- * | [[onHttp]] | Fired with each HTTP response from your server. (see [[Config.url]]). |
49
- * | [[onActivityChange]] | Fired with each change in device motion-activity. |
50
- * | [[onProviderChange]] | Fired after changes to device location-services configuration. |
51
- * | [[onHeartbeat]] | Periodic timed events. See [[heartbeatInterval]]. iOS requires [[preventSuspend]]. |
52
- * | [[onGeofence]] | Fired with each [[Geofence]] transition event (`ENTER, EXIT, DWELL`). |
53
- * | [[onGeofencesChange]] | Fired when the list of actively-monitored geofences changed. See [[geofenceProximityRadius]]. |
54
- * | [[onSchedule]] | Fired for [[schedule]] events. |
55
- * | [[onConnectivityChange]] | Fired when network-connectivity changes (connected / disconnected). |
56
- * | [[onPowerSaveChange]] | Fired when state of operating-system's "power-saving" feature is enabled / disabled. |
57
- * | [[onEnabledChange]] | Fired when the plugin is enabled / disabled via its [[start]] / [[stop]] methods. |
58
- * | [[onAuthorization]] | Fired when a response from [[Authorization.refreshUrl]] is received. |
59
- * | [[onNotificationAction]] | __Android only__: Fired when a button is clicked on a custom [[Notification.layout]] of a foreground-service notification. |
60
- *
61
- * ## 🔧 [[Config]] API
62
- *
63
- * [[BackgroundGeolocation]] is highly configurable. See the [[Config]] API for more information.
64
- *
65
- * There are three main steps to using `BackgroundGeolocation`
66
- * 1. Wire up event-listeners.
67
- * 2. [[ready]] the SDK.
68
- * 3. [[start]] tracking.
69
- *
70
- * @example
71
- * ```typescript
72
- *
73
- * ////
74
- * // 1. Wire up event-listeners
75
- * //
76
- *
77
- * // This handler fires whenever bgGeo receives a location update.
78
- * BackgroundGeolocation.onLocation(location => {
79
- * console.log("[location] ", location);
80
- * }, error => {
81
- * console.log("[location] ERROR: ", error);
82
- * });
83
- *
84
- * // This handler fires when movement states changes (stationary->moving; moving->stationary)
85
- * BackgroundGeolocation.onMotionChange(location => {
86
- * console.log("[motionchange] ", location);
87
- * });
88
- *
89
- * // This handler fires on HTTP responses
90
- * BackgroundGeolocation.onHttp(response => {
91
- * console.log("[http] ", response);
92
- * });
93
- *
94
- * // This event fires when a change in motion activity is detected
95
- * BackgroundGeolocation.onActivityChange(activityEvent => {
96
- * console.log("[activitychange] ", activityEvent);
97
- * });
98
- *
99
- * // This event fires when the user toggles location-services authorization
100
- * BackgroundGeolocation.onProviderChange(providerEvent => {
101
- * console.log("[providerchange] ", providerEvent);
102
- * });
103
- *
104
- * ////
105
- * // 2. Execute #ready method (required)
106
- * //
107
- * BackgroundGeolocation.ready({
108
- * // Geolocation Config
109
- * desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
110
- * distanceFilter: 10,
111
- * // Activity Recognition
112
- * stopTimeout: 1,
113
- * // Application config
114
- * debug: true, // <-- enable this hear debug sounds.
115
- * logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
116
- * stopOnTerminate: false, // <-- Allow the background-service to continue tracking when app terminated.
117
- * startOnBoot: true, // <-- Auto start tracking when device is powered-up.
118
- * // HTTP / SQLite config
119
- * url: "http://yourserver.com/locations",
120
- * batchSync: false, // <-- Set true to sync locations to server in a single HTTP request.
121
- * autoSync: true, // <-- Set true to sync each location to server as it arrives.
122
- * headers: { // <-- Optional HTTP headers
123
- * "X-FOO": "bar"
124
- * },
125
- * params: { // <-- Optional HTTP params
126
- * "auth_token": "maybe_your_server_authenticates_via_token_YES?"
127
- * }
128
- * }, (state) => {
129
- * console.log("- BackgroundGeolocation is configured and ready: ", state.enabled);
130
- *
131
- * if (!state.enabled) {
132
- * ////
133
- * // 3. Start tracking!
134
- * //
135
- * BackgroundGeolocation.start(function() {
136
- * console.log("- Start success");
137
- * });
138
- * }
139
- * });
140
- *
141
- * ```
142
- *
143
- * @example
144
- * ```typescript
145
- * BackgroundGeolocation.ready({
146
- * distanceFilter: 10,
147
- * stopOnTerminate: false,
148
- * logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
149
- * debug: true
150
- * }, (state) => {
151
- * console.log("- BackgroundGeolocation is ready: ", state);
152
- * });
153
- * ```
154
- *
155
- * ### ⚠️ Warning:
156
- * Do not execute *any* API method which will require accessing location-services until the callback to [[ready]] executes (eg: [[getCurrentPosition]], [[watchPosition]], [[start]]).
157
- *
158
- * ### Promise API
159
- *
160
- * The `BackgroundGeolocation` Javascript API supports [Promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) for *nearly* every method (the exceptions are [[watchPosition]] and adding event-listeners via **`#onEventName`** methods.)
161
- * @example
162
- * ```typescript
163
- * // Traditional API still works:
164
- * BackgroundGeolocation.ready({desiredAccuracy: 0, distanceFilter: 50}).then(state => {
165
- * console.log("- BackgroundGeolocation is ready: ", state);
166
- * }).catch(error => {
167
- * console.log("- BackgroundGeolocation error: ", error);
168
- * });
169
- * ```
170
- */
171
- export class BackgroundGeolocation {
172
- static EVENT_BOOT: Event;
173
- static EVENT_TERMINATE: Event;
174
- static EVENT_LOCATION: Event;
175
- static EVENT_MOTIONCHANGE: Event;
176
- static EVENT_HTTP: Event;
177
- static EVENT_HEARTBEAT: Event;
178
- static EVENT_PROVIDERCHANGE: Event;
179
- static EVENT_ACTIVITYCHANGE: Event;
180
- static EVENT_GEOFENCE: Event;
181
- static EVENT_GEOFENCESCHANGE: Event;
182
- static EVENT_ENABLEDCHANGE: Event;
183
- static EVENT_CONNECTIVITYCHANGE: Event;
184
- static EVENT_SCHEDULE: Event;
185
- static EVENT_POWERSAVECHANGE: Event;
186
- static EVENT_NOTIFICATIONACTION: Event;
187
- static EVENT_AUTHORIZATION: Event;
188
-
189
- static LOG_LEVEL_OFF: LogLevel;
190
- static LOG_LEVEL_ERROR: LogLevel;
191
- static LOG_LEVEL_WARNING: LogLevel;
192
- static LOG_LEVEL_INFO: LogLevel;
193
- static LOG_LEVEL_DEBUG: LogLevel;
194
- static LOG_LEVEL_VERBOSE: LogLevel;
195
-
196
- static DESIRED_ACCURACY_NAVIGATION:LocationAccuracy;
197
- static DESIRED_ACCURACY_HIGH:LocationAccuracy;
198
- static DESIRED_ACCURACY_MEDIUM:LocationAccuracy;
199
- static DESIRED_ACCURACY_LOW:LocationAccuracy;
200
- static DESIRED_ACCURACY_VERY_LOW:LocationAccuracy;
201
- static DESIRED_ACCURACY_LOWEST:LocationAccuracy;
202
-
203
- static AUTHORIZATION_STATUS_NOT_DETERMINED:AuthorizationStatus;
204
- static AUTHORIZATION_STATUS_RESTRICTED:AuthorizationStatus;
205
- static AUTHORIZATION_STATUS_DENIED:AuthorizationStatus;
206
- static AUTHORIZATION_STATUS_ALWAYS:AuthorizationStatus;
207
- static AUTHORIZATION_STATUS_WHEN_IN_USE:AuthorizationStatus;
208
-
209
- static NOTIFICATION_PRIORITY_DEFAULT:NotificationPriority;
210
- static NOTIFICATION_PRIORITY_HIGH:NotificationPriority;
211
- static NOTIFICATION_PRIORITY_LOW:NotificationPriority;
212
- static NOTIFICATION_PRIORITY_MAX:NotificationPriority;
213
- static NOTIFICATION_PRIORITY_MIN:NotificationPriority;
214
-
215
- static ACTIVITY_TYPE_OTHER:ActivityType;
216
- static ACTIVITY_TYPE_AUTOMOTIVE_NAVIGATION:ActivityType;
217
- static ACTIVITY_TYPE_FITNESS:ActivityType;
218
- static ACTIVITY_TYPE_OTHER_NAVIGATION:ActivityType;
219
- static ACTIVITY_TYPE_AIRBORNE:ActivityType;
220
-
221
- static PERSIST_MODE_ALL: PersistMode;
222
- static PERSIST_MODE_LOCATION: PersistMode;
223
- static PERSIST_MODE_GEOFENCE: PersistMode;
224
- static PERSIST_MODE_NONE: PersistMode;
225
-
226
- static ACCURACY_AUTHORIZATION_FULL: AccuracyAuthorization;
227
- static ACCURACY_AUTHORIZATION_REDUCED: AccuracyAuthorization;
228
-
229
- /**
230
- * [[DeviceSettings]] API
231
- *
232
- * Provides an API to show Android & vendor-specific Battery / Power Management settings screens that can affect performance of the Background Geolocation SDK on various devices.
233
- *
234
- * The site [Don't Kill My App](https://dontkillmyapp.com/) provides a comprehensive list of poor Android vendors which throttle background-services that this plugin relies upon.
235
- *
236
- * This [[DeviceSettings]] API is an attempt to provide resources to direct the user to the appropriate vendor-specific settings screen to resolve issues with background operation.
237
- *
238
- * ![](https://dl.dropboxusercontent.com/s/u7ljngfecxvibyh/huawei-settings-battery-launch.jpg?dl=1)
239
- * ![](https://dl.dropboxusercontent.com/s/hd6yxw58hgc7ef4/android-settings-battery-optimization.jpg?dl=1)
240
- *
241
- */
242
- static deviceSettings: DeviceSettings;
243
-
244
- /**
245
- * [[Logger]] API
246
- */
247
- static logger: Logger;
248
-
249
- /**
250
- * @hidden
251
- */
252
- static addListener(event: string, success:Function, failure?:Function):void;
253
- /**
254
- * @hidden
255
- */
256
- static on(event: string, success:Function, failure?:Function):void;
257
- /**
258
- * @deprecated. Use [[Subscription]] returned from __`BackgroundGeolocation.onXXX`__ to remove listeners.
259
- *
260
- * @example
261
- * ```typescript
262
- * const subscription = BackgroundGeolocation.onLocation((location) => {
263
- * console.log('[onLocation]', location);
264
- * });
265
- * .
266
- * .
267
- * .
268
- * // Remove listener
269
- * subscription.remove();
270
- * ```
271
- *
272
- * ---------------------------------------------------------------------
273
- * ### ⚠️ [Deprecated]
274
- *
275
- * Removes an event listener. You must supply the *type* of event to remove in addition to a reference to the *exact* function you
276
- * used to subscribe to the event.
277
- *
278
- *
279
- * | Event |
280
- * |----------------------|
281
- * | `location` |
282
- * | `motionchange` |
283
- * | `activitychange` |
284
- * | `providerchange` |
285
- * | `geofence` |
286
- * | `geofenceschange` |
287
- * | `heartbeat` |
288
- * | `http` |
289
- * | `powersavechange` |
290
- * | `schedule` |
291
- * | `connectivitychange` |
292
- * | `enabledchange` |
293
- *
294
- * @example
295
- * ```typescript
296
- * const locationHandler = (location) => {
297
- * console.log("[location] - ", location)
298
- * }
299
- * BackgroundGeolocation.onLocation(locationHandler)
300
- * .
301
- * .
302
- * // Remove the listener providing a reference to the original callback.
303
- * BackgroundGeolocation.removeListener("location", locationHandler)
304
- * ```
305
- */
306
- static removeListener(event: string, handler: Function, success?:Function, failure?:Function): void;
307
-
308
- /**
309
- * Alias for [[removeListener]].
310
- * @ignore
311
- */
312
- static un(event: string, handler: Function, success?:Function, failure?:Function): void;
313
-
314
- /**
315
- * Removes all event-listeners.
316
- *
317
- * Calls [[Subscription.remove]] on all subscriptions.
318
- *
319
- * @example
320
- * ```typescript
321
- * BackgroundGeolocation.removeListeners();
322
- * ```
323
- */
324
- static removeListeners(success?:Function, failure?:Function): Promise<void>;
325
-
326
- /**
327
- * Alias for [[removeListeners]]
328
- */
329
- static removeAllListeners(success?:Function, failure?:Function): Promise<void>;
330
-
331
- /**
332
- * Subscribe to location events.
333
- *
334
- * Every location recorded by the SDK is provided to your `callback`, including those from [[onMotionChange]], [[getCurrentPosition]] and [[watchPosition]].
335
- *
336
- * @example
337
- * ```typescript
338
- * const subscription = BackgroundGeolocation.onLocation((location) => {
339
- * console.log("[onLocation] success: ", location);
340
- * }, (error) => {
341
- * console.log("[onLocation] ERROR: ", error);
342
- * });
343
- * ```
344
- *
345
- * ### Error Codes
346
- *
347
- * If the native location API fails to return a location, the `failure` callback will be provided a [[LocationError]].
348
- *
349
- * ### ⚠️ Note [[Location.sample]]:
350
- *
351
- * When performing a [[onMotionChange]] or [[getCurrentPosition]], the plugin requests **multiple** location *samples* in order to record the most accurate location possible. These *samples* are **not** persisted to the database but they will be provided to your `callback`, for your convenience, since it can take some seconds for the best possible location to arrive.
352
- *
353
- * For example, you might use these samples to progressively update the user's position on a map. You can detect these *samples* in your `callback` via `location.sample == true`. If you're manually `POST`ing location to your server, you should ignore these locations.
354
- *
355
- * @event location
356
- */
357
- static onLocation(success: (location:Location)=>void, failure?:(errorCode: LocationError) => void):Subscription;
358
-
359
- /**
360
- * Subscribe to Geofence transition events.
361
- *
362
- * Your supplied `callback` will be called when any monitored geofence crossing occurs.
363
- *
364
- * @example
365
- * ```typescript
366
- * const subscription = BackgroundGeolocation.onGeofence((event) => {
367
- * console.log("[onGeofence] ", event);
368
- * });
369
- * ```
370
- *
371
- * ### ℹ️ See also:
372
- * - 📘 [[Geofence | Geofencing Guide]]
373
- *
374
- * @event geofence
375
- */
376
- static onGeofence(callback: (event: GeofenceEvent) => void):Subscription;
377
-
378
- /**
379
- * Subscribe to __`motionchange`__ events.
380
- *
381
- * Your `callback` will be executed each time the device has changed-state between **MOVING** or **STATIONARY**.
382
- *
383
- *
384
- * @example
385
- * ```typescript
386
- * const subscription = BackgroundGeolocation.onMotionChange((event) => {
387
- * if (event.isMoving) {
388
- * console.log("[onMotionChange] Device has just started MOVING ", event.location);
389
- * } else {
390
- * console.log("[onMotionChange] Device has just STOPPED: ", event.location);
391
- * }
392
- * });
393
- * ```
394
- *
395
- * ----------------------------------------------------------------------
396
- * ### ⚠️ Warning: `autoSyncThreshold`
397
- *
398
- * If you've configured [[Config.autoSyncThreshold]], it **will be ignored** during a `onMotionChange` event &mdash; all queued locations will be uploaded, since:
399
- * - If an `onMotionChange` event fires **into the *moving* state**, the device may have been sitting dormant for a long period of time. The plugin is *eager* to upload this state-change to the server as soon as possible.
400
- * - If an `onMotionChange` event fires **into the *stationary* state**, the device may be about to lie dormant for a long period of time. The plugin is *eager* to upload all queued locations to the server before going dormant.
401
- * ----------------------------------------------------------------------
402
- *
403
- * ### ℹ️ See also:
404
- * - [[stopTimeout]]
405
- * - 📘 [Philosophy of Operation](github:wiki/Philosophy-of-Operation)
406
- *
407
- * @event motionchange
408
- */
409
- static onMotionChange(callback: (event:MotionChangeEvent) => void): Subscription;
410
-
411
- /**
412
- * Subscribe to HTTP responses from your server [[Config.url]].
413
- *
414
- * @example
415
- * ```typescript
416
- * const subscription = BackgroundGeolocation.onHttp((response) => {
417
- * let status = response.status;
418
- * let success = response.success;
419
- * let responseText = response.responseText;
420
- * console.log("[onHttp] ", response);
421
- * });
422
- * ```
423
- * ### ℹ️ See also:
424
- * - [[HttpEvent | HTTP Guide]]
425
- *
426
- * @event http
427
- */
428
- static onHttp(callback: (response:HttpEvent) => void): Subscription;
429
-
430
- /**
431
- * Subscribe to changes in motion activity.
432
- *
433
- * Your `callback` will be executed each time the activity-recognition system receives an event (`still, on_foot, in_vehicle, on_bicycle, running`).
434
- *
435
- * ### Android
436
- * Android [[MotionActivityEvent.confidence]] always reports `100`%.
437
- *
438
- * @example
439
- * ```typescript
440
- * const subscription = BackgroundGeolocation.onActivityChange((event) => {
441
- * console.log("[onActivityChange] ", event);
442
- * });
443
- * ```
444
- * @event activitychange
445
- */
446
- static onActivityChange(callback: (event: MotionActivityEvent) => void): Subscription;
447
-
448
- /**
449
- * Subscribe to changes in device's location-services configuration / authorization.
450
- *
451
- * Your `callback` fill be executed whenever a change in the state of the device's **Location Services** has been detected. eg: "GPS ON", "WiFi only".
452
- *
453
- * @example
454
- * ```typescript
455
- * const subscription = BackgroundGeolocation.onProviderChange((event) => {
456
- * console.log("[onProviderChange: ", event);
457
- *
458
- * switch(event.status) {
459
- * case BackgroundGeolocation.AUTHORIZATION_STATUS_DENIED:
460
- * // Android & iOS
461
- * console.log("- Location authorization denied");
462
- * break;
463
- * case BackgroundGeolocation.AUTHORIZATION_STATUS_ALWAYS:
464
- * // Android & iOS
465
- * console.log("- Location always granted");
466
- * break;
467
- * case BackgroundGeolocation.AUTHORIZATION_STATUS_WHEN_IN_USE:
468
- * // iOS only
469
- * console.log("- Location WhenInUse granted");
470
- * break;
471
- * }
472
- * });
473
- * ```
474
- *
475
- * ### ℹ️ See also:
476
- * - You can explicitly request the current state of location-services using [[getProviderState]].
477
- *
478
- * ### ⚠️ Note:
479
- * - The plugin always force-fires an [[onProviderChange]] event whenever the app is launched (right after the [[ready]] method is executed), regardless of current state, so you can learn the the current state of location-services with each boot of your application.
480
- *
481
- * @event providerchange
482
- */
483
- static onProviderChange(callback: (event:ProviderChangeEvent) => void): Subscription;
484
-
485
- /**
486
- * Subscribe to periodic heartbeat events.
487
- *
488
- * Your `callback` will be executed for each [[heartbeatInterval]] while the device is in **stationary** state (**iOS** requires [[preventSuspend]]: true as well).
489
- *
490
- * @example
491
- * ```typescript
492
- * BackgroundGeolocation.ready({
493
- * heartbeatInterval: 60,
494
- * preventSuspend: true // <-- Required for iOS
495
- * });
496
- *
497
- * const subscription = BackgroundGeolocation.onHeartbeat((event) => {
498
- * console.log("[onHeartbeat] ", event);
499
- *
500
- * // You could request a new location if you wish.
501
- * BackgroundGeolocation.getCurrentPosition({
502
- * samples: 1,
503
- * persist: true
504
- * }).then((location) => {
505
- * console.log("[getCurrentPosition] ", location);
506
- * });
507
- * })
508
- * ```
509
- *
510
- * ### ⚠️ Note:
511
- * - The [[Location]] provided by the [[HeartbeatEvent]] is only the last-known location. The *heartbeat* event does not actively engage location-services. If you wish to get the current location in your `callback`, use [[getCurrentPosition]].
512
- * @event heartbeat
513
- */
514
- static onHeartbeat(callback: (event: HeartbeatEvent) => void): Subscription;
515
-
516
- /**
517
- * Subscribe to changes in actively monitored geofences.
518
- *
519
- * Fired when the list of monitored-geofences changed. The BackgroundGeolocation SDK contains powerful geofencing features that allow you to monitor
520
- * any number of circular geofences you wish (thousands even), in spite of limits imposed by the native platform APIs (**20 for iOS; 100 for Android**).
521
- *
522
- * The plugin achieves this by storing your geofences in its database, using a [geospatial query](https://en.wikipedia.org/wiki/Spatial_query) to determine
523
- * those geofences in proximity (@see [[geofenceProximityRadius]]), activating only those geofences closest to the device's current location
524
- * (according to limit imposed by the corresponding platform).
525
- *
526
- * When the device is determined to be moving, the plugin periodically queries for geofences in proximity (eg. every minute) using the latest recorded
527
- * location. This geospatial query is **very fast**, even with tens-of-thousands geofences in the database.
528
- *
529
- * It's when this list of monitored geofences *changes*, that the plugin will fire the `onGeofencesChange` event.
530
- *
531
- * @example
532
- * ```typescript
533
- * const subscription = BackgroundGeolocation.onGeofencesChange((event) => {
534
- * let on = event.on; //<-- new geofences activated.
535
- * let off = event.off; //<-- geofences that were just de-activated.
536
- *
537
- * // Create map circles
538
- * on.forEach((geofence) => {
539
- * createGeofenceMarker(geofence)
540
- * });
541
- *
542
- * // Remove map circles
543
- * off.forEach((identifier) => {
544
- * removeGeofenceMarker(identifier);
545
- * }
546
- * });
547
- * ```
548
- *
549
- * ### ℹ️ See also:
550
- * - 📘 [[Geofence | Geofencing Guide]]
551
- * @event geofenceschange
552
- */
553
- static onGeofencesChange(callback: (event: GeofencesChangeEvent) => void): Subscription;
554
-
555
- /**
556
- * Subscribe to [[schedule]] events.
557
- *
558
- * Your `callback` will be executed each time a [[schedule]] event fires. Your `callback` will be provided with the current [[State]]: **`state.enabled`**
559
- * will reflect the state according to your [[schedule]].
560
- *
561
- * @example
562
- * ```typescript
563
- * const subscription = BackgroundGeolocation.onSchedule((state) => {
564
- * if (state.enabled) {
565
- * console.log("[onSchedule] scheduled start tracking");
566
- * } else {
567
- * console.log("[onSchedule] scheduled stop tracking");
568
- * }
569
- * });
570
- * ```
571
- * @event schedule
572
- */
573
- static onSchedule(callback: (state:State) => void): Subscription;
574
-
575
- /**
576
- * Subscribe to changes in network connectivity.
577
- *
578
- * Fired when the state of the device's network-connectivity changes (enabled -> disabled and vice-versa). By default, the plugin will automatically fire
579
- * a `connectivitychange` event with the current state network-connectivity whenever the [[start]] method is executed.
580
- *
581
- * ℹ️ The SDK subscribes internally to `connectivitychange` events &mdash; if you've configured the SDK's HTTP Service (See [[HttpEvent | HTTP Guide]]) and your app has queued locations,
582
- * the SDK will automatically initiate uploading to your configured [[Config.url]] when network connectivity is detected.
583
- *
584
- * @example
585
- * ```typescript
586
- * const subscription = BackgroundGeolocation.onConnectivityChange((event) => {
587
- * console.log("[onConnectivityChange] ", event);
588
- * });
589
- * ```
590
- * @event connectivitychange
591
- */
592
- static onConnectivityChange(callback: (event:ConnectivityChangeEvent) => void): Subscription;
593
-
594
- /**
595
- * Subscribe to state changes in OS power-saving system.
596
- *
597
- * Fired when the state of the operating-system's "Power Saving" mode changes. Your `callback` will be provided with a `bool` showing whether
598
- * "Power Saving" is **enabled** or **disabled**. Power Saving mode can throttle certain services in the background, such as HTTP requests or GPS.
599
- * @break
600
- *
601
- * ℹ️ You can manually request the current-state of "Power Saving" mode with the method [[isPowerSaveMode]].
602
- *
603
- * ### iOS
604
- *
605
- * iOS Power Saving mode can be engaged manually by the user in **Settings -> Battery** or from an automatic OS dialog.
606
- *
607
- * ![](https://dl.dropboxusercontent.com/s/lz3zl2jg4nzstg3/Screenshot%202017-09-19%2010.34.21.png?dl=1)
608
- *
609
- * ### Android
610
- *
611
- * Android Power Saving mode can be engaged manually by the user in **Settings -> Battery -> Battery Saver** or automatically with a user-specified "threshold" (eg: 15%).
612
- *
613
- * ![](https://dl.dropboxusercontent.com/s/raz8lagrqayowia/Screenshot%202017-09-19%2010.33.49.png?dl=1)
614
- *
615
- * @example
616
- * ```typescript
617
- * const subscription = BackgroundGeolocation.onPowerSaveChange((isPowerSaveMode) => {
618
- * console.log("[onPowerSaveChange: ", isPowerSaveMode);
619
- * });
620
- * ```
621
- * @event powersavechange
622
- */
623
- static onPowerSaveChange(callback: (enabled:boolean) => void): Subscription;
624
-
625
- /**
626
- * Subscribe to changes in plugin [[State.enabled]].
627
- *
628
- * Fired when the SDK's [[State.enabled]] changes. For example, executing [[start]] and [[stop]] will cause the `onEnabledChnage` event to fire.
629
- * This event is primarily designed for use with the configuration option [[stopAfterElapsedMinutes]], which automatically executes the SDK's
630
- * [[stop]] method.
631
- *
632
- * @example
633
- * ```typescript
634
- * const subscription = BackgroundGeolocation.onEnabledChange(isEnabled => {
635
- * console.log("[onEnabledChanged] isEnabled? ", isEnabled);
636
- * });
637
- * ```
638
- * @event enabledchange
639
- */
640
- static onEnabledChange(callback: (enabled:boolean) => void): Subscription;
641
-
642
- /**
643
- * [__Android-only__] Subscribe to button-clicks of a custom [[Notification.layout]] on the Android foreground-service notification.
644
- */
645
- static onNotificationAction(callback: (buttonId:string) => void): Subscription;
646
-
647
- /**
648
- * Subscribe to [[Authorization]] events.
649
- *
650
- * Fired when [[Authorization.refreshUrl]] responds, either successfully or not. If successful, [[AuthorizationEvent.success]] will be `true` and [[AuthorizationEvent.response]] will
651
- * contain the decoded JSON response returned from the server.
652
- *
653
- * If authorization failed, [[AuthorizationEvent.error]] will contain the error message.
654
- *
655
- * @example
656
- * ```typescript
657
- * const subscription = BackgroundGeolocation.onAuthorization((event) => {
658
- * if (event.success) {
659
- * console.log("[authorization] ERROR: ", event.error);
660
- * } else {
661
- * console.log("[authorization] SUCCESS: ", event.response);
662
- * }
663
- * });
664
- * ```
665
- *
666
- */
667
- static onAuthorization(callback: (event:AuthorizationEvent) => void): Subscription;
668
-
669
- /**
670
- * Registers a Javascript callback to execute in the Android "Headless" state, where the app has been terminated configured with
671
- * [[stopOnTerminate]]`:false`. * The received `event` object contains a `name` (the event name) and `params` (the event data-object).
672
- *
673
- * ### ⚠️ Note Cordova &amp; Capacitor
674
- * - Javascript headless callbacks are not supported by Cordova or Capacitor. See [Android Headless Mode](github:wiki/Android-Headless-Mode)
675
- *
676
- * ### ⚠️ Warning:
677
- * - You __must__ `registerHeadlessTask` in your application root file (eg: `index.js`).
678
- *
679
- * ### ⚠️ Warning:
680
- * - Your `function` __must__ be declared as `async`. You must `await` all work within your task. Your headless-task will automatically be terminated after executing the last line of your function.
681
- *
682
- * @example
683
- * ```typescript
684
- * const BackgroundGeolocationHeadlessTask = async (event) => {
685
- * const params = event.params;
686
- * console.log("[BackgroundGeolocation HeadlessTask] -", event.name, params);
687
- *
688
- * switch (event.name) {
689
- * case "terminate":
690
- * // Use await for async tasks
691
- * const location = await BackgroundGeolocation.getCurrentPosition({
692
- * samples: 1,
693
- * persist: false
694
- * });
695
- * console.log("[BackgroundGeolocation HeadlessTask] - getCurrentPosition:", location);
696
- * break;
697
- * }
698
- * // You must await all work you do in your task.
699
- * // Headless-tasks are automatically terminated after executing the last line of your function.
700
- * await doWork();
701
- * }
702
- *
703
- * BackgroundGeolocation.registerHeadlessTask(BackgroundGeolocationHeadlessTask);
704
- * ```
705
- *
706
- * ### Debugging
707
- *
708
- * While implementing your headless-task It's crucial to observe your Android logs in a terminal via
709
- *
710
- * ```bash
711
- * $ adb logcat *:S TSLocationManager:V ReactNativeJS:V
712
- *
713
- * TSLocationManager: [c.t.r.HeadlessTask onHeadlessEvent] 💀 event: connectivitychange
714
- * TSLocationManager: [c.t.r.HeadlessTask createReactContextAndScheduleTask] initialize ReactContext
715
- * TSLocationManager: [c.t.r.HeadlessTask onHeadlessEvent] 💀 event: providerchange
716
- * TSLocationManager: [c.t.r.HeadlessTask onHeadlessEvent] 💀 event: terminate
717
- * ReactNativeJS: '[BGGeoHeadlessTask] ', 'connectivitychange', taskId: 1
718
- * TSLocationManager: [c.t.r.HeadlessTask invokeStartTask] taskId: 1
719
- * TSLocationManager: [c.t.r.HeadlessTask invokeStartTask] taskId: 2
720
- * TSLocationManager: [c.t.r.HeadlessTask invokeStartTask] taskId: 3
721
- * ReactNativeJS: '[BGGeoHeadlessTask] ', 'providerchange', taskId: 2
722
- * ReactNativeJS: '[BGGeoHeadlessTask] ', 'terminate', taskId: 3
723
- * TSLocationManager: [c.t.l.u.BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 1
724
- * TSLocationManager: [c.t.l.u.BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 2
725
- * ReactNativeJS: *** [doWork] START
726
- * ReactNativeJS: *** [doWork] START
727
- * TSLocationManager: [c.t.l.u.BackgroundTaskManager$Task start] ⏳ startBackgroundTask: 3
728
- * ReactNativeJS: *** [doWork] START
729
- * .
730
- * .
731
- * .
732
- * ReactNativeJS: *** [doWork] FINISH
733
- * ReactNativeJS: *** [doWork] FINISH
734
- * ReactNativeJS: *** [doWork] FINISH
735
- * TSLocationManager: [c.t.l.u.BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 1
736
- * TSLocationManager: [c.t.l.u.BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 2
737
- * TSLocationManager: [c.t.l.u.BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 3
738
- * TSLocationManager: [c.t.r.HeadlessTask$1 onHeadlessJsTaskFinish] taskId: 1
739
- * TSLocationManager: [c.t.r.HeadlessTask$1 onHeadlessJsTaskFinish] taskId: 2
740
- * TSLocationManager: [c.t.r.HeadlessTask$1 onHeadlessJsTaskFinish] taskId: 3
741
- * ```
742
- *
743
- * ### ℹ️ See also:
744
- * - 📘 [Android Headless Mode](github:wiki/Android-Headless-Mode).
745
- * - [[Config.enableHeadless]]
746
- *
747
- */
748
- static registerHeadlessTask(callback:(event:HeadlessEvent)=> Promise<void>): void;
749
-
750
- /**
751
- *
752
- * Signal to the plugin that your app is launched and ready, proving the default [[Config]].
753
- *
754
- * The supplied [[Config]] will be applied **only at first install** of your app — for every launch thereafter,
755
- * the plugin will automatically load its last-known configuration from persistent storage.
756
- * The plugin always remembers the configuration you apply to it.
757
- *
758
- * @example
759
- * ```typescript
760
- * BackgroundGeolocation.ready({
761
- * desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
762
- * distanceFilter: 10,
763
- * stopOnTerminate: false,
764
- * startOnBoot: true,
765
- * url: "http://your.server.com",
766
- * headers: {
767
- * "my-auth-token": "secret-token"
768
- * }
769
- * }).then((state) => {
770
- * console.log("[ready] success", state);
771
- * });
772
- * ```
773
- *
774
- * ### ⚠️ Warning: You must call __`.ready(confg)`__ **once** and **only** once, each time your app is launched.
775
- * - Do not hide the call to `#ready` within a view which is loaded only by clicking a UI action. This is particularly important
776
- * for iOS in the case where the OS relaunches your app in the background when the device is detected to be moving. If you don't ensure that `#ready` is called in this case, tracking will not resume.
777
- *
778
- * ### The [[reset]] method.
779
- *
780
- * If you wish, you can use the [[reset]] method to reset all [[Config]] options to documented default-values (with optional overrides):
781
- *
782
- * ### [[Config.reset]]: false
783
- *
784
- * Configuring the plugin with __`reset: false`__ should generally be avoided unless you know *exactly* what it does. People often find this from the *Demo* app. If you do configure `reset: false`, you'll find that your `Config` provided to `.ready` is consumed **only at first launch after install**. Thereafter, the plugin will ignore any changes you've provided there. The only way to change the config then is to use [[setConfig]].
785
- *
786
- * You will especially not want to use `reset: false` during development, while you're fine-tuning your `Config` options.
787
- *
788
- * The reason the *Demo* app uses `reset: false` is because it hosts an advanced "*Settings*" screen to tune the `Config` at runtime and we don't want those runtime changes to be overwritten by `.ready(config)` each time the app launches.
789
- *
790
- * ⚠️ If you *don't* undestand what __`reset: false`__ does, **NO NOT USE IT**. If you blindly copy/pasted it from the *Demo* app, **REMOVE IT** from your `Config`.
791
- *
792
- * @example
793
- * ```typescript
794
- * BackgroundGeolocation.reset();
795
- * // Reset to documented default-values with overrides
796
- * bgGeo.reset({
797
- * distanceFilter: 10
798
- * });
799
- * ```
800
- */
801
- static ready(config: Config, success?:(state:State) => void, failure?:(error:string) => void): Promise<State>;
802
-
803
- /**
804
- * @ignore
805
- * __DEPRECATED__. Use [[ready]] instead.
806
- */
807
- static configure(config: Config, success?:(state:State) => void, failure?:Function): Promise<State>;
808
-
809
- /**
810
- *
811
- * Re-configure the SDK's [[Config]] parameters. This is the method to use when you wish to *change*
812
- * the plugin [[Config]] *after* [[ready]] has been executed.
813
- *
814
- * The supplied [[Config]] will be appended to the current configuration and applied in realtime.
815
- *
816
- * @example
817
- * ```typescript
818
- * BackgroundGeolocation.setConfig({
819
- * desiredAccuracy: Config.DESIRED_ACCURACY_HIGH,
820
- * distanceFilter: 100.0,
821
- * stopOnTerminate: false,
822
- * startOnBoot: true
823
- * }).then((state) => {
824
- * console.log("[setConfig] success: ", state);
825
- * })
826
- * ```
827
- */
828
- static setConfig(config: Config, success?:(state:State) => void, failure?:Function): Promise<State>;
829
-
830
- /**
831
- * Resets the plugin configuration to documented default-values.
832
- *
833
- * If an optional [[Config]] is provided, it will be applied *after* the configuration reset.
834
- *
835
- */
836
- static reset(config?:Config, success?:(state:State) => void, failure?:Function): Promise<State>;
837
-
838
- /**
839
- * Enable location + geofence tracking.
840
- *
841
- * This is the SDK's power **ON** button. The plugin will initially start into its **stationary** state, fetching an initial location before
842
- * turning off location services. Android will be monitoring its **Activity Recognition System** while iOS will create a stationary geofence around
843
- * the current location.
844
- *
845
- * ### ⚠️ Note:
846
- * If you've configured a [[schedule]], this method will override that schedule and engage tracking immediately.
847
- *
848
- * @example
849
- * ```typescript
850
- * BackgroundGeolocation.start().then((state) => {
851
- * console.log("[start] success - ", state);
852
- * });
853
- * ```
854
- *
855
- * ### ℹ️ See also:
856
- * - [[stop]]
857
- * - [[startGeofences]]
858
- * - 📘 [Philosophy of Operation](github:wiki/Philosophy-of-Operation)
859
- */
860
- static start(success?:(state:State) => void, error?:(error:string) => void): Promise<State>;
861
-
862
- /**
863
- * Disable location and geofence monitoring. This is the SDK's power **OFF** button.
864
- *
865
- * @example
866
- * ```typescript
867
- * BackgroundGeolocation.stop();
868
- * ```
869
- *
870
- * ### ⚠️ Note:
871
- * If you've configured a [[schedule]], **`#stop`** will **not** halt the Scheduler. You must explicitly [[stopSchedule]] as well:
872
- *
873
- * @example
874
- * ```typescript
875
- * // Later when you want to stop the Scheduler (eg: user logout)
876
- * BackgroundGeolocation.stopSchedule();
877
- * ```
878
- */
879
- static stop(success?:(state:State) => void, error?: (error:string) => void): Promise<State>;
880
-
881
- /**
882
- * Manually toggles the SDK's **motion state** between **stationary** and **moving**.
883
- *
884
- * When provided a value of **`true`**, the plugin will engage location-services and begin aggressively tracking the device's location *immediately*,
885
- * bypassing stationary monitoring.
886
- *
887
- * If you were making a "Jogging" application, this would be your **`[Start Workout]`** button to immediately begin location-tracking. Send **`false`**
888
- * to turn **off** location-services and return the plugin to the **stationary** state.
889
- *
890
- * @example
891
- * ```typescript
892
- * BackgroundGeolocation.changePace(true); // <-- Location-services ON ("moving" state)
893
- * BackgroundGeolocation.changePace(false); // <-- Location-services OFF ("stationary" state)
894
- * ```
895
- */
896
- static changePace(isMoving:boolean, success?: Function, failure?:(error:string) => void): Promise<void>;
897
-
898
- /**
899
- * Engages the geofences-only [[State.trackingMode]].
900
- *
901
- * In this mode, no active location-tracking will occur &mdash; only geofences will be monitored. To stop monitoring "geofences" [[TrackingMode]],
902
- * simply use the usual [[stop]] method.
903
- *
904
- * @example
905
- * ```typescript
906
- * // Add a geofence.
907
- * BackgroundGeolocation.addGeofence({
908
- * notifyOnExit: true,
909
- * radius: 200,
910
- * identifier: "ZONE_OF_INTEREST",
911
- * latitude: 37.234232,
912
- * longitude: 42.234234
913
- * });
914
- *
915
- * // Listen to geofence events.
916
- * BackgroundGeolocation.onGeofence((event) => {
917
- * console.log("[onGeofence] - ", event);
918
- * });
919
- *
920
- * // Configure the plugin
921
- * BackgroundGeolocation.ready({
922
- * url: "http://my.server.com",
923
- * autoSync: true
924
- * }).then(((state) => {
925
- * // Start monitoring geofences.
926
- * BackgroundGeolocation.startGeofences();
927
- * });
928
- * ```
929
- *
930
- * ### ℹ️ See also:
931
- * - [[stop]]
932
- * - 📘 [[Geofence | Geofencing Guide]]
933
- */
934
- static startGeofences(success?:(state:State) => void, failure?:(error:string) => void): Promise<State>;
935
-
936
- /**
937
- * Return the current [[State]] of the plugin, including all [[Config]] parameters.
938
- *
939
- * @example
940
- * ```typescript
941
- * let state = await BackgroundGeolocation.getState();
942
- * console.log("[state] ", state.enabled, state.trackingMode);
943
- * ```
944
- */
945
- static getState(success?: (state:State) => void, failure?: (error:string) => void): Promise<State>;
946
-
947
- /**
948
- * Initiate the configured [[schedule]].
949
- *
950
- * If a [[schedule]] was configured, this method will initiate that schedule. The plugin will automatically be started or stopped according to
951
- * the configured [[schedule]].
952
- *
953
- * To halt scheduled tracking, use [[stopSchedule]].
954
- *
955
- * @example
956
- * ```typescript
957
- * BackgroundGeolocation.startSchedule.then((state) => {
958
- * console.log("[startSchedule] success: ", state);
959
- * })
960
- * ```
961
- * ### ℹ️ See also:
962
- * - [[schedule]]
963
- * - [[startSchedule]]
964
- */
965
- static startSchedule(success?: (state:State) => void, failure?: (error:string) => void): Promise<State>;
966
-
967
- /**
968
- * Halt scheduled tracking.
969
- *
970
- * @example
971
- * ```typescript
972
- * BackgroundGeolocation.stopSchedule.then((state) => {
973
- * console.log("[stopSchedule] success: ", state);
974
- * })
975
- * ```
976
- *
977
- * ⚠️ [[stopSchedule]] will **not** execute [[stop]] if the plugin is currently tracking. You must explicitly execute [[stop]].
978
- *
979
- * @example
980
- * ```typescript
981
- * // Later when you want to stop the Scheduler (eg: user logout)
982
- * await BackgroundGeolocation.stopSchedule().then((state) => {
983
- * if (state.enabled) {
984
- * BackgroundGeolocation.stop();
985
- * }
986
- * })
987
- * ```
988
- * ### ℹ️ See also:
989
- * - [[startSchedule]]
990
- *
991
- */
992
- static stopSchedule(success?: (state:State) => void, failure?: (error:string) => void): Promise<State>;
993
-
994
- /**
995
- * Sends a signal to OS that you wish to perform a long-running task.
996
- *
997
- * The OS will keep your running in the background and not suspend it until you signal completion with the [[stopBackgroundTask]] method. Your callback will be provided with a single parameter `taskId`
998
- * which you will send to the [[stopBackgroundTask]] method.
999
- *
1000
- * @example
1001
- * ```typescript
1002
- * onLocation(location) {
1003
- * console.log("[location] ", location);
1004
- *
1005
- * // Perform some long-running task (eg: HTTP request)
1006
- * BackgroundGeolocation.startBackgroundTask().then((taskId) => {
1007
- * performLongRunningTask.then(() => {
1008
- * // When your long-running task is complete, signal completion of taskId.
1009
- * BackgroundGeolocation.stopBackgroundTask(taskId);
1010
- * }).catch(error) => {
1011
- * // Be sure to catch errors: never leave you background-task hanging.
1012
- * console.error(error);
1013
- * BackgroundGeolocation.stopBackgroundTask();
1014
- * });
1015
- * });
1016
- * }
1017
- * ```
1018
- *
1019
- * ### iOS
1020
- * The iOS implementation uses [beginBackgroundTaskWithExpirationHandler](https://developer.apple.com/documentation/uikit/uiapplication/1623031-beginbackgroundtaskwithexpiratio)
1021
- *
1022
- * ⚠️ iOS provides **exactly** 180s of background-running time. If your long-running task exceeds this time, the plugin has a fail-safe which will
1023
- * automatically [[stopBackgroundTask]] your **`taskId`** to prevent the OS from force-killing your application.
1024
- *
1025
- * Logging of iOS background tasks looks like this:
1026
- * ```
1027
- * ✅-[BackgroundTaskManager createBackgroundTask] 1
1028
- * .
1029
- * .
1030
- * .
1031
- *
1032
- * ✅-[BackgroundTaskManager stopBackgroundTask:]_block_invoke 1 OF (
1033
- * 1
1034
- * )
1035
- * ```
1036
- * ### Android
1037
- *
1038
- * The Android implementation launches a [`WorkManager`](https://developer.android.com/topic/libraries/architecture/workmanager) task.
1039
- *
1040
- * ⚠️ The Android plugin imposes a limit of **3 minutes** for your background-task before it automatically `FORCE KILL`s it.
1041
- *
1042
- *
1043
- * Logging for Android background-tasks looks like this (when you see an hourglass ⏳ icon, a foreground-service is active)
1044
- * ```
1045
- * I TSLocationManager: [c.t.l.u.BackgroundTaskManager onStartJob] ⏳ startBackgroundTask: 6
1046
- * .
1047
- * .
1048
- * .
1049
- * I TSLocationManager: [c.t.l.u.BackgroundTaskManager$Task stop] ⏳ stopBackgroundTask: 6
1050
- * ```
1051
- *
1052
- */
1053
- static startBackgroundTask(success?: (taskId:number) => void, failure?: Function): Promise<number>;
1054
-
1055
- /**
1056
- * Signal completion of [[startBackgroundTask]]
1057
- *
1058
- * Sends a signal to the native OS that your long-running task, addressed by `taskId` provided by [[startBackgroundTask]] is complete and the OS may proceed
1059
- * to suspend your application if applicable.
1060
- *
1061
- * @example
1062
- * ```typescript
1063
- * BackgroundGeolocation.startBackgroundTask().then((taskId) => {
1064
- * // Perform some long-running task (eg: HTTP request)
1065
- * performLongRunningTask.then(() => {
1066
- * // When your long-running task is complete, signal completion of taskId.
1067
- * BackgroundGeolocation.stopBackgroundTask(taskId);
1068
- * });
1069
- * });
1070
- * ```
1071
- */
1072
- static stopBackgroundTask(taskId: number, success?: Function, failure?: Function): Promise<number>;
1073
-
1074
- /**
1075
- * @alias [[stopBackgroundTask]]
1076
- * @deprecated
1077
- */
1078
- static finish(taskId: number, success?: Function, failure?: Function): Promise<number>;
1079
-
1080
- /**
1081
- * @private
1082
- * __[Android-only]__ Signals completion of an Android headless-task (see [[Config.enableHeadless]])
1083
- */
1084
- static finishHeadlessTask(taskId: number, success?: Function, failure?: Function): Promise<number>;
1085
-
1086
- /**
1087
- * Retrieves the current [[Location]].
1088
- *
1089
- * This method instructs the native code to fetch exactly one location using maximum power & accuracy. The native code will persist the fetched location to
1090
- * its SQLite database just as any other location in addition to POSTing to your configured [[Config.url]].
1091
- * If an error occurs while fetching the location, `catch` will be provided with an [[LocationError]].
1092
- * @break
1093
- *
1094
- * ### Options
1095
- *
1096
- * See [[CurrentPositionRequest]].
1097
- *
1098
- * ### Error Codes
1099
- *
1100
- * See [[LocationError]].
1101
- *
1102
- * @example
1103
- * ```typescript
1104
- * let location = await BackgroundGeolocation.getCurrentPosition({
1105
- * timeout: 30, // 30 second timeout to fetch location
1106
- * maximumAge: 5000, // Accept the last-known-location if not older than 5000 ms.
1107
- * desiredAccuracy: 10, // Try to fetch a location with an accuracy of `10` meters.
1108
- * samples: 3, // How many location samples to attempt.
1109
- * extras: { // Custom meta-data.
1110
- * "route_id": 123
1111
- * }
1112
- * });
1113
- * ```
1114
- * ### ⚠️ Note:
1115
- * - While [[getCurrentPosition]] will receive only **one** [[Location]], the plugin *does* request **multiple** location samples which will all be provided
1116
- * to the [[onLocation]] event-listener. You can detect these samples via [[Location.sample]] `== true`.
1117
- */
1118
- static getCurrentPosition(options: CurrentPositionRequest, success?:(location:Location) => void, failure?:(errorCode:LocationError) => void): Promise<Location>;
1119
-
1120
- /**
1121
- * Start a stream of continuous location-updates. The native code will persist the fetched location to its SQLite database
1122
- * just as any other location (If the SDK is currently [[State.enabled]]) in addition to POSTing to your configured [[Config.url]] (if you've enabled the HTTP features).
1123
- *
1124
- * ### ⚠️ Warning:
1125
- * `watchPosition` is **not** recommended for **long term** monitoring in the background &mdash; It's primarily designed for use in the foreground **only**. You might use it for fast-updates of the user's current position on the map, for example.
1126
- * The SDK's primary [Philosophy of Operation](github:wiki/Philosophy-of-Operation) **does not require** `watchPosition`.
1127
- *
1128
- * #### iOS
1129
- * `watchPosition` will continue to run in the background, preventing iOS from suspending your application. Take care to listen to `suspend` event and call [[stopWatchPosition]] if you don't want your app to keep running in the background, consuming battery.
1130
- *
1131
- * @example
1132
- * ```typescript
1133
- * onResume() {
1134
- * // Start watching position while app in foreground.
1135
- * BackgroundGeolocation.watchPosition((location) => {
1136
- * console.log("[watchPosition] -", location);
1137
- * }, (errorCode) => {
1138
- * console.log("[watchPosition] ERROR -", errorCode);
1139
- * }, {
1140
- * interval: 1000
1141
- * })
1142
- * }
1143
- *
1144
- * onSuspend() {
1145
- * // Halt watching position when app goes to background.
1146
- * BackgroundGeolocation.stopWatchPosition();
1147
- * }
1148
- * ```
1149
- */
1150
- static watchPosition(success: (location:Location) => void, failure?: (errorCode:LocationError) => void, options?: WatchPositionRequest): void;
1151
-
1152
- /**
1153
- * Stop watch-position updates initiated from [[watchPosition]].
1154
- * @example
1155
- * ```typescript
1156
- * onResume() {
1157
- * // Start watching position while app in foreground.
1158
- * BackgroundGeolocation.watchPosition((location) => {
1159
- * console.log("[watchPosition] -", location);
1160
- * }, (errorCode) => {
1161
- * console.log("[watchPosition] ERROR -", errorCode);
1162
- * }, {
1163
- * interval: 1000
1164
- * })
1165
- * }
1166
- *
1167
- * onSuspend() {
1168
- * // Halt watching position when app goes to background.
1169
- * BackgroundGeolocation.stopWatchPosition();
1170
- * }
1171
- * ```
1172
- * ### ℹ️ See also:
1173
- * - [[stopWatchPosition]]
1174
- *
1175
- */
1176
- static stopWatchPosition(success?: Function, failure?: Function): Promise<void>;
1177
-
1178
- /**
1179
- * Retrieve a List of [[Location]] currently stored in the SDK's SQLite database.
1180
- *
1181
- * @example
1182
- * ```typescript
1183
- * let locations = await BackgroundGeolocation.getLocations();
1184
- * ```
1185
- */
1186
- static getLocations(success?:(locations:Array<Object>) => void, failure?:Function): Promise<Array<Object>>;
1187
-
1188
- /**
1189
- * Retrieve the count of all locations current stored in the SDK's SQLite database.
1190
- *
1191
- * @example
1192
- * ```typescript
1193
- * let count = await BackgroundGeolocation.getCount();
1194
- * ```
1195
- */
1196
- static getCount(success?:(count:number)=>void, failure?:Function): Promise<number>;
1197
-
1198
- /**
1199
- * Remove all records in SDK's SQLite database.
1200
- *
1201
- * @example
1202
- * ```typescript
1203
- * let success = await BackgroundGeolocation.destroyLocations();
1204
- * ```
1205
- */
1206
- static destroyLocations(success?:Function, failure?:Function): Promise<void>;
1207
-
1208
- /**
1209
- * Destroy a single location by [[Location.uuid]]
1210
- *
1211
- * @example
1212
- * ```typescript
1213
- * await BackgroundGeolocation.destroyLocation(location.uuid);
1214
- * ```
1215
- */
1216
- static destroyLocation(uuid:String): Promise<void>;
1217
-
1218
- static insertLocation(params:Location, success?:(location:Location) => void, failure?:Function): Promise<Location>;
1219
-
1220
- /**
1221
- * Manually execute upload to configured [[Config.url]]
1222
- *
1223
- * If the plugin is configured for HTTP with an [[Config.url]] and [[autoSync]] `false`, the [[sync]] method will initiate POSTing the locations
1224
- * currently stored in the native SQLite database to your configured [[Config.url]]. When your HTTP server returns a response of `200 OK`, that record(s)
1225
- * in the database will be DELETED.
1226
- *
1227
- * If you configured [[batchSync]] `true`, all the locations will be sent to your server in a single HTTP POST request, otherwise the plugin will
1228
- * execute an HTTP post for **each** [[Location]] in the database (REST-style). Your callback will be executed and provided with a `List` of all the
1229
- * locations from the SQLite database. If you configured the plugin for HTTP (by configuring a [[Config.url]], your callback will be executed after all
1230
- * the HTTP request(s) have completed. If the plugin failed to sync to your server (possibly because of no network connection), the failure callback will
1231
- * be called with an error message. If you are **not** using the HTTP features, [[sync]] will delete all records from its SQLite database.
1232
- *
1233
- * @example
1234
- * ```typescript
1235
- * BackgroundGeolocation.sync((records) => {
1236
- * console.log("[sync] success: ", records);
1237
- * }).catch((error) => {
1238
- * console.log("[sync] FAILURE: ", error);
1239
- * });
1240
- *
1241
- * ```
1242
- * ℹ️ For more information, see the [[HttpEvent | HTTP Guide]]
1243
- */
1244
- static sync(success?:(locations:Array<Object>) => void, failure?:Function): Promise<Array<Object>>;
1245
-
1246
- /**
1247
- * Retrieve the current distance-traveled ("odometer").
1248
- *
1249
- * The plugin constantly tracks distance traveled, computing the distance between the current location and last and maintaining the sum. To fetch the
1250
- * current **odometer** reading:
1251
- *
1252
- * @example
1253
- * ```typescript
1254
- * let odometer = await BackgroundGeolocation.getOdometer();
1255
- * ```
1256
- *
1257
- * ### ℹ️ See also:
1258
- * - [[desiredOdometerAccuracy]].
1259
- * - [[resetOdometer]] / [[setOdometer]].
1260
- *
1261
- * ### ⚠️ Warning:
1262
- * - Odometer calculations are dependent upon the accuracy of received locations. If location accuracy is poor, this will necessarily introduce error into odometer calculations.
1263
- */
1264
- static getOdometer(success?:(odometer:number) => void, failure?:Function): Promise<number>;
1265
-
1266
- /**
1267
- * Initialize the `odometer` to *any* arbitrary value.
1268
- *
1269
- * @example
1270
- * ```typescript
1271
- * BackgroundGeolocation.setOdometer(1234.56).then((location) => {
1272
- * // This is the location where odometer was set at.
1273
- * console.log("[setOdometer] success: ", location);
1274
- * });
1275
- * ```
1276
- *
1277
- * ### ⚠️ Note:
1278
- * - [[setOdometer]] will internally perform a [[getCurrentPosition]] in order to record the exact location *where* odometer was set.
1279
- */
1280
- static setOdometer(value:number, success?:(location:Location) => void, failure?:Function): Promise<Location>;
1281
-
1282
- /**
1283
- * Initialize the `odometer` to `0`.
1284
- *
1285
- * @example
1286
- * ```typescript
1287
- * BackgroundGeolocation.resetOdometer().then((location) => {
1288
- * // This is the location where odometer was set at.
1289
- * console.log("[setOdometer] success: ", location);
1290
- * });
1291
- * ```
1292
- *
1293
- * ### ⚠️ Note:
1294
- * - [[resetOdometer]] will internally perform a [[getCurrentPosition]] in order the record to exact location *where* odometer was set.
1295
- * - [[resetOdometer]] is the same as [[setOdometer]]`:0`.
1296
- */
1297
- static resetOdometer(success?:Function, failure?:Function): Promise<Location>;
1298
-
1299
- /**
1300
- * Adds a [[Geofence]] to be monitored by the native Geofencing API.
1301
- *
1302
- * @example
1303
- * ```typescript
1304
- * BackgroundGeolocation.addGeofence({
1305
- * identifier: "Home",
1306
- * radius: 150,
1307
- * latitude: 45.51921926,
1308
- * longitude: -73.61678581,
1309
- * notifyOnEntry: true,
1310
- * notifyOnExit: false,
1311
- * notifyOnDwell: true,
1312
- * loiteringDelay: 30000, // 30 seconds
1313
- * extras: { // Optional arbitrary meta-data
1314
- * zone_id: 1234
1315
- * }
1316
- * }).then((success) => {
1317
- * console.log("[addGeofence] success");
1318
- * }).catch((error) => {
1319
- * console.log("[addGeofence] FAILURE: ", error);
1320
- * });
1321
- * ```
1322
- *
1323
- * ### ℹ️ Note:
1324
- * - If a geofence(s) *already* exists with the configured [[Geofence.identifier]], the previous one(s) will be **deleted** before the new one is inserted.
1325
- * - When adding *multiple*, it's about **10 times faster** to use [[addGeofences]] instead.
1326
- * - 📘 [[Geofence | Geofencing Guide]]
1327
- */
1328
-
1329
- static addGeofence(config:Geofence, success?:Function, failure?:(error:string) => void): Promise<void>;
1330
- /**
1331
- * Adds a list of [[Geofence]] to be monitored by the native Geofencing API.
1332
- *
1333
- * @example
1334
- * ```typescript
1335
- * let geofences = [{
1336
- * identifier: "foo",
1337
- * radius: 200,
1338
- * latitude: 45.51921926,
1339
- * longitude: -73.61678581,
1340
- * notifyOnEntry: true
1341
- * },
1342
- * identifier: "bar",
1343
- * radius: 200,
1344
- * latitude: 45.51921926,
1345
- * longitude: -73.61678581,
1346
- * notifyOnEntry: true
1347
- * }];
1348
- *
1349
- * BackgroundGeolocation.addGeofences(geofences);
1350
- * ```
1351
- *
1352
- * ### ℹ️ Note:
1353
- * - If a geofence(s) *already* exists with the configured [[Geofence.identifier]], the previous one(s) will be **deleted** before the new one is inserted.
1354
- * - 📘 [[Geofence | Geofencing Guide]]
1355
- * - [[addGeofence]]
1356
- *
1357
- */
1358
- static addGeofences(geofences: Array<Geofence>, success?: Function, failure?: Function): Promise<void>;
1359
-
1360
- /**
1361
- * Removes a [[Geofence]] having the given [[Geofence.identifier]].
1362
- *
1363
- * @example
1364
- * ```typescript
1365
- * BackgroundGeolocation.removeGeofence("Home").then((success) => {
1366
- * console.log("[removeGeofence] success");
1367
- * }).catch((error) => {
1368
- * console.log("[removeGeofence] FAILURE: ", error);
1369
- * });
1370
- * ```
1371
- *
1372
- * ### ℹ️ See also:
1373
- * - 📘 [[Geofence | Geofencing Guide]]
1374
- */
1375
- static removeGeofence(identifier: string, success?: Function, failure?: Function): Promise<void>;
1376
-
1377
- /**
1378
- * Destroy all [[Geofence]]
1379
- *
1380
- * @example
1381
- * ```typescript
1382
- * BackgroundGeolocation.removeGeofences();
1383
- * ```
1384
- *
1385
- * ### ℹ️ See also:
1386
- * - 📘 [[Geofence | Geofencing Guide]]
1387
- */
1388
- static removeGeofences(success?: Function, failure?: Function): Promise<void>;
1389
-
1390
- /**
1391
- * Fetch a list of all [[Geofence]] in the SDK's database. If there are no geofences being monitored, you'll receive an empty `Array`.
1392
- *
1393
- * @example
1394
- * ```typescript
1395
- * let geofences = await BackgroundGeolocation.getGeofences();
1396
- * console.log("[getGeofences: ", geofences);
1397
- * ```
1398
- * ### ℹ️ See also:
1399
- * - 📘 [[Geofence | Geofencing Guide]]
1400
- */
1401
- static getGeofences(success?:(geofences:Array<Geofence>) => void, failure?: (error:string) => void): Promise<Array<Geofence>>;
1402
-
1403
- /**
1404
- * Fetch a single [[Geofence]] by identifier from the SDK's database.
1405
- *
1406
- * @example
1407
- * ```typescript
1408
- * let geofence = await BackgroundGeolocation.getGeofence("HOME");
1409
- * console.log("[getGeofence] ", geofence);
1410
- * ```
1411
- *
1412
- * ### ℹ️ See also:
1413
- * - 📘 [[Geofence | Geofencing Guide]]
1414
- */
1415
- static getGeofence(identifier:string, success?:(geofence:Geofence) => void, failure?: (error:string) => void): Promise<Geofence>;
1416
-
1417
- /**
1418
- * Determine if a particular geofence exists in the SDK's database.
1419
- *
1420
- * @example
1421
- * ```typescript
1422
- * let exists = await BackgroundGeolocation.geofenceExists("HOME");
1423
- * console.log("[geofenceExists] ", exists);
1424
- * ```
1425
- * ### ℹ️ See also:
1426
- * - 📘 [[Geofence | Geofencing Guide]]
1427
- */
1428
- static geofenceExists(identifier:string, callback?:(exists:boolean) => void): Promise<boolean>;
1429
-
1430
- /**
1431
- * Sets the [[logLevel]].
1432
- */
1433
- static setLogLevel(value: LogLevel, success?:(state:State) => void, failure?:Function): Promise<State>;
1434
-
1435
- /**
1436
- * @deprecated Use [[Logger.getLog]].
1437
- */
1438
- static getLog(success?:(log:string) => void, failure?:(error:string) => void): Promise<string>;
1439
-
1440
- /**
1441
- * @deprecated Use [[Logger.emailLog]].
1442
- */
1443
- static emailLog(email:string, success?:Function, failure?:(error:string) => void): Promise<void>;
1444
-
1445
- /**
1446
- * @deprecated Use [[Logger.destroyLog]].
1447
- */
1448
- static destroyLog(success?:Function, failure?:Function): Promise<void>;
1449
-
1450
- /**
1451
- * Fetches the state of the operating-system's "Power Saving" mode.
1452
- * @break
1453
- *
1454
- * Power Saving mode can throttle certain services in the background, such as HTTP requests or GPS.
1455
- *
1456
- * ℹ️ You can listen to changes in the state of "Power Saving" mode from the event [[onPowerSaveChange]].
1457
- *
1458
- * ### iOS
1459
- *
1460
- * iOS Power Saving mode can be engaged manually by the user in **Settings -> Battery** or from an automatic OS dialog.
1461
- *
1462
- * ![](https://dl.dropboxusercontent.com/s/lz3zl2jg4nzstg3/Screenshot%202017-09-19%2010.34.21.png?dl=1)
1463
- *
1464
- * ### Android
1465
- *
1466
- * Android Power Saving mode can be engaged manually by the user in **Settings -> Battery -> Battery Saver** or automatically with a user-specified
1467
- * "threshold" (eg: 15%).
1468
- *
1469
- * ![](https://dl.dropboxusercontent.com/s/raz8lagrqayowia/Screenshot%202017-09-19%2010.33.49.png?dl=1)
1470
- *
1471
- * @example
1472
- * ```typescript
1473
- * let isPowerSaveMode = await BackgroundGeolocation.isPowerSaveMode;
1474
- * ```
1475
- */
1476
- static isPowerSaveMode(success?:(enabled:boolean) => void, failure?:Function): Promise<boolean>;
1477
-
1478
- /**
1479
- * Returns the presence of device sensors *accelerometer*, *gyroscope*, *magnetometer*
1480
- * @break
1481
- *
1482
- * These core [[Sensors]] are used by the motion activity-recognition system -- when any of these sensors are missing from a device (particularly on cheap
1483
- * Android devices), the performance of the motion activity-recognition system will be **severely** degraded and highly inaccurate.
1484
- *
1485
- * For devices which *are* missing any of these sensors, you can increase the motion-detection sensitivity by decreasing
1486
- * [[minimumActivityRecognitionConfidence]].
1487
- *
1488
- * @example
1489
- * ```typescript
1490
- * let sensors = await BackgroundGeolocation.sensors;
1491
- * console.log(sensors);
1492
- * ```
1493
- */
1494
- static getSensors(success?:(sensors:Sensors) => void, failure?:Function): Promise<Sensors>;
1495
-
1496
- static getDeviceInfo(): Promise<DeviceInfo>;
1497
-
1498
- /**
1499
- * Retrieves the current state of location-provider authorization.
1500
- *
1501
- * ### ℹ️ See also:
1502
- * - You can also *listen* for changes in location-authorization using the event [[onProviderChange]].
1503
- *
1504
- * @example
1505
- * ```typescript
1506
- * let providerState = await BackgroundGeolocation.getProviderState();
1507
- * console.log("- Provider state: ", providerState);
1508
- * ```
1509
- */
1510
- static getProviderState(success?:(state:ProviderChangeEvent) => void, failure?:Function): Promise<ProviderChangeEvent>;
1511
-
1512
- /**
1513
- * Manually request location permission from the user with the configured [[Config.locationAuthorizationRequest]].
1514
- *
1515
- * The method will resolve successful if *either* __`WhenInUse`__ or __`Always`__ is authorized, regardless of [[Config.locationAuthorizationRequest]]. Otherwise an error will be returned (eg: user denies location permission).
1516
- *
1517
- * If the user has already provided authorization for location-services, the method will resolve successfully immediately.
1518
- *
1519
- * If iOS has *already* presented the location authorization dialog and the user has not currently authorized your desired [[Config.locationAuthorizationRequest]], the SDK will present an error dialog offering to direct the user to your app's Settings screen.
1520
- * - To disable this behaviour, see [[Config.disableLocationAuthorizationAlert]].
1521
- * - To customize the text on this dialog, see [[Config.locationAuthorizationAlert]].
1522
- *
1523
- * ### ⚠️ Note:
1524
- * - The SDK will **already request permission** from the user when you execute [[start]], [[startGeofences]], [[getCurrentPosition]], etc. You **do not need to explicitly execute this method** with typical use-cases.
1525
- *
1526
- * @example
1527
- * ```typescript
1528
- * async componentDidMount() {
1529
- * // Listen to onProviderChange to be notified when location authorization changes occur.
1530
- * BackgroundGeolocation.onProviderChange((event) => {
1531
- * console.log('[providerchange]', event);
1532
- * });
1533
- *
1534
- * // First ready the plugin with your configuration.
1535
- * let state = await BackgroundGeolocation.ready({
1536
- * locationAuthorizationRequest: 'Always'
1537
- * });
1538
- *
1539
- * // Manually request permission with configured locationAuthorizationRequest.
1540
- * try {
1541
- * int status = await BackgroundGeolocation.requestPermission();
1542
- * console.log('[requestPermission] success: ', status);
1543
- * } catch(status) {
1544
- * console.warn('[requestPermission] FAILURE: ', status);
1545
- * }
1546
- * }
1547
- * ```
1548
- *
1549
- * ### ℹ️ See also:
1550
- * - [[Config.locationAuthorizationRequest]]
1551
- * - [[Config.disableLocationAuthorizationAlert]]
1552
- * - [[Config.locationAuthorizationAlert]]
1553
- * - [[Config.backgroundPermissionRationale]] (*Android 11+*)
1554
- * - [[requestTemporaryFullAccuracy]] (*iOS 14+*)
1555
- */
1556
- static requestPermission(success?:(status:AuthorizationStatus) => void, failure?:(status:AuthorizationStatus) => void): Promise<AuthorizationStatus>;
1557
-
1558
- /**
1559
- * __`[iOS 14+]`__ iOS 14 has introduced a new __`[Precise: On]`__ switch on the location authorization dialog allowing users to disable high-accuracy location.
1560
- *
1561
- * The method [`requestTemporaryFullAccuracy` (Apple docs)](https://developer.apple.com/documentation/corelocation/cllocationmanager/3600217-requesttemporaryfullaccuracyauth?language=objc) will allow you to present a dialog to the user requesting temporary *full accuracy* for the lifetime of this application run (until terminate).
1562
- *
1563
- * ![](https://dl.dropbox.com/s/dj93xpg51vspqk0/ios-14-precise-on.png?dl=1)
1564
- *
1565
- * ## Configuration &mdash; `Info.plist`
1566
- *
1567
- * In order to use this method, you must configure your __`Info.plist`__ with the `Dictionary` key:
1568
- * __`Privacy - Location Temporary Usage Description Dictionary`__
1569
- *
1570
- * ![](https://dl.dropbox.com/s/52f5lnjc4d9g8w7/ios-14-Privacy-Location-Temporary-Usage-Description-Dictionary.png?dl=1)
1571
- *
1572
- * The keys of this `Dictionary` (eg: `Delivery`) are supplied as the first argument to the method. The `value` will be printed on the dialog shown to the user, explaing the purpose of your request for full accuracy.
1573
- *
1574
- * If the dialog fails to be presented, an error will be thrown:
1575
- * - The Info.plist file doesn’t have an entry for the given purposeKey value.
1576
- * - The app is already authorized for full accuracy.
1577
- * - The app is in the background.
1578
- *
1579
- * ![](https://dl.dropbox.com/s/8cc0sniv3pvpetl/ios-14-requestTemporaryFullAccuracy.png?dl=1)
1580
- *
1581
- * __Note:__ Android and older versions of iOS `< 14` will return [[BackgroundGeolocation.ACCURACY_AUTHORIZATION_FULL]].
1582
- *
1583
- * @example
1584
- *
1585
- * ```javascript
1586
- * BackgroundGeolocation.onProviderChange((event) => {
1587
- * if (event.accuracyAuthorization == BackgroundGeolocation.ACCURACY_AUTHORIZATION_REDUCED) {
1588
- * // Supply "Purpose" key from Info.plist as 1st argument.
1589
- * BackgroundGeolocation.requestTemporaryFullAccuracy("Delivery").then((accuracyAuthorization) => {
1590
- * if (accuracyAuthorization == BackgroundGeolocation.ACCURACY_AUTHORIZATION_FULL) {
1591
- * console.log('[requestTemporaryFullAccuracy] GRANTED: ', accuracyAuthorization);
1592
- * } else {
1593
- * console.log('[requestTemporaryFullAccuracy] DENIED: ', accuracyAuthorization);
1594
- * }
1595
- * }).catch((error) => {
1596
- * console.warn("[requestTemporaryFullAccuracy] FAILED TO SHOW DIALOG: ", error);
1597
- * });
1598
- * }
1599
- * });
1600
- * ```
1601
- *
1602
- * __See also:__
1603
- * - [[ProviderChangeEvent.accuracyAuthorization]].
1604
- * - [What's new in iOS 14 `CoreLocation`](https://levelup.gitconnected.com/whats-new-with-corelocation-in-ios-14-bd28421c95c4)
1605
- *
1606
- */
1607
- static requestTemporaryFullAccuracy(purpose:string):Promise<AccuracyAuthorization>;
1608
-
1609
- /**
1610
- *
1611
- */
1612
- static playSound(soundId:any, success?:Function, failure?:Function): Promise<void>;
1613
-
1614
- /**
1615
- * @deprecated Use [[Config.transistorAuthorizationToken]]
1616
- */
1617
- static transistorTrackerParams(device:Object):Object;
1618
-
1619
- /**
1620
- * Returns a *JSON Web Token* ([JWT](https://jwt.io/)) suitable for [[Authorization]] with the Transistor Software demo server at http://tracker.transistorsoft.com.
1621
- *
1622
- * To learn how to upload locations to the *Transistor Demo Server*, see [[TransistorAuthorizationToken]].
1623
- * ![](https://dl.dropboxusercontent.com/s/3abuyyhioyypk8c/screenshot-tracker-transistorsoft.png?dl=1)
1624
- *
1625
- * This token is typically provided to [[Config.transistorAuthorizationToken]] when first configuring the SDK with [[ready]].
1626
- *
1627
- * ### Params
1628
- *
1629
- * #### `@param {String} orgname`
1630
- *
1631
- * Represents a "company" or "organization"; a container for posting locations from multiple devices to the same account. `orgname` is used for accessing your device results in web app, eg: http://tracker.transistorsoft.com/my-organization-name.
1632
- *
1633
- * #### `@param {String} username`
1634
- *
1635
- * Appended to the [[DeviceInfo.model]] as a means of creating a consistent and unique device identifier. For example:
1636
- * - `Pixel 3a-my-username`
1637
- * - `A310-my-username`
1638
- * - `iPhone 11,3-my-username`
1639
- *
1640
- * #### `@param {String} url [http://tracker.transistorsoft.com]`
1641
- *
1642
- * The server to register with and receive authentication tokens from. Defaults to `http://tracker.transistorsoft.com`. If you have a local instance of [background-geolocation-console](https://github.com/transistorsoft/background-geolocation-console) running
1643
- * on your localhost, you would provide the __ip address__ of your server, eg: `http://192.168.0.100:9000`.
1644
- *
1645
- * --------------------------------------------------
1646
- *
1647
- *
1648
- * When the SDK receives the [[TransistorAuthorizationToken]] from `url`, it will be cached in persistant-storage within the native code. If the SDK doesn"t find a cached token on the client, it will automatically register for one from `url`, using the provided `orgname` and `username`. Otherwise, the cached token will be immediately returned.
1649
- *
1650
- *
1651
- * @example
1652
- * ```typescript
1653
- * let orgname = "my-company-name";
1654
- * let username = "my-username";
1655
- *
1656
- * let token = await BackgroundGeolocation.findOrCreateTransistorAuthorizationToken(orgname, username);
1657
- *
1658
- * BackgroundGeolocation.ready({
1659
- * transistorAuthorizationToken: token
1660
- * });
1661
- * ```
1662
- *
1663
- * ### ℹ️ See also:
1664
- * - [[destroyTransistorAuthorizationToken]]
1665
- * - [[Config.transistorAuthorizationToken]]
1666
- */
1667
- static findOrCreateTransistorAuthorizationToken(orgname:string, username:string, url?:string): Promise<TransistorAuthorizationToken>;
1668
-
1669
- /**
1670
- * Destroys the cached Transistor JSON Web Token used to authorize with the Demo Server at http://tracker.transistorsoft.com or your local instance of [background-geolocation-console](https://github.com/transistorsoft/background-geolocation-console)
1671
- *
1672
- * @example
1673
- * ```typescript
1674
- * await BackgroundGeolocation.destroyTransistorAuthorizationToken();
1675
- * ```
1676
- *
1677
- * ### ℹ️ See also:
1678
- * - [[findOrCreateTransistorAuthorizationToken]]
1679
- */
1680
- static destroyTransistorAuthorizationToken(url?:string): Promise<boolean>;
1681
- }
1682
- export default BackgroundGeolocation;
1683
- }