react-native-background-geolocation 4.4.2 → 4.4.6
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.
- package/CHANGELOG.md +15 -0
- package/README.md +209 -61
- package/android/libs/com/transistorsoft/tslocationmanager/{3.1.34/tslocationmanager-3.1.34.aar → 3.1.37/tslocationmanager-3.1.37.aar} +0 -0
- package/android/libs/com/transistorsoft/tslocationmanager/3.1.37/tslocationmanager-3.1.37.aar.md5 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager/3.1.37/tslocationmanager-3.1.37.aar.sha1 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager/3.1.37/tslocationmanager-3.1.37.aar.sha256 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager/3.1.37/tslocationmanager-3.1.37.aar.sha512 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager/{3.1.34/tslocationmanager-3.1.34.pom → 3.1.37/tslocationmanager-3.1.37.pom} +1 -1
- package/android/libs/com/transistorsoft/tslocationmanager/3.1.37/tslocationmanager-3.1.37.pom.md5 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager/3.1.37/tslocationmanager-3.1.37.pom.sha1 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager/3.1.37/tslocationmanager-3.1.37.pom.sha256 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager/3.1.37/tslocationmanager-3.1.37.pom.sha512 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager/maven-metadata.xml +6 -6
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/{3.1.34/tslocationmanager-reverse-3.1.34.aar → 3.1.37/tslocationmanager-reverse-3.1.37.aar} +0 -0
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.37/tslocationmanager-reverse-3.1.37.aar.md5 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.37/tslocationmanager-reverse-3.1.37.aar.sha1 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.37/tslocationmanager-reverse-3.1.37.aar.sha256 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.37/tslocationmanager-reverse-3.1.37.aar.sha512 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/{3.1.34/tslocationmanager-reverse-3.1.34.pom → 3.1.37/tslocationmanager-reverse-3.1.37.pom} +1 -1
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.37/tslocationmanager-reverse-3.1.37.pom.md5 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.37/tslocationmanager-reverse-3.1.37.pom.sha1 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.37/tslocationmanager-reverse-3.1.37.pom.sha256 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.37/tslocationmanager-reverse-3.1.37.pom.sha512 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/maven-metadata.xml +6 -6
- package/ios/RNBackgroundGeolocation/RNBackgroundGeolocation.m +7 -7
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/Info.plist +9 -9
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Info.plist +0 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/TSLocationManager +0 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Info.plist +0 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/TSLocationManager +0 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/_CodeSignature/CodeDirectory +0 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/_CodeSignature/CodeRequirements-1 +0 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/_CodeSignature/CodeResources +1 -1
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Resources/Info.plist +9 -9
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/TSLocationManager +0 -0
- package/package.json +1 -1
- package/android/libs/com/transistorsoft/tslocationmanager/3.1.34/tslocationmanager-3.1.34.aar.md5 +0 -1
- package/android/libs/com/transistorsoft/tslocationmanager/3.1.34/tslocationmanager-3.1.34.aar.sha1 +0 -1
- package/android/libs/com/transistorsoft/tslocationmanager/3.1.34/tslocationmanager-3.1.34.aar.sha256 +0 -1
- package/android/libs/com/transistorsoft/tslocationmanager/3.1.34/tslocationmanager-3.1.34.aar.sha512 +0 -1
- package/android/libs/com/transistorsoft/tslocationmanager/3.1.34/tslocationmanager-3.1.34.pom.md5 +0 -1
- package/android/libs/com/transistorsoft/tslocationmanager/3.1.34/tslocationmanager-3.1.34.pom.sha1 +0 -1
- package/android/libs/com/transistorsoft/tslocationmanager/3.1.34/tslocationmanager-3.1.34.pom.sha256 +0 -1
- package/android/libs/com/transistorsoft/tslocationmanager/3.1.34/tslocationmanager-3.1.34.pom.sha512 +0 -1
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.34/tslocationmanager-reverse-3.1.34.aar.md5 +0 -1
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.34/tslocationmanager-reverse-3.1.34.aar.sha1 +0 -1
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.34/tslocationmanager-reverse-3.1.34.aar.sha256 +0 -1
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.34/tslocationmanager-reverse-3.1.34.aar.sha512 +0 -1
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.34/tslocationmanager-reverse-3.1.34.pom.md5 +0 -1
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.34/tslocationmanager-reverse-3.1.34.pom.sha1 +0 -1
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.34/tslocationmanager-reverse-3.1.34.pom.sha256 +0 -1
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.34/tslocationmanager-reverse-3.1.34.pom.sha512 +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.4.6 — 2022-03-29
|
|
4
|
+
* [Android] While testing adding 20k geofences, the Logger can cause an `OutOfMemory` error. Define a dedicated thread executor `Executors.newFixedThreadPool(2)` for posting log messages in background.
|
|
5
|
+
* [iOS] remote event-listeners in onAppTerminate to prevent onEnabledChange event being fired in a dying app configured for `stopOnTerminate: true`
|
|
6
|
+
|
|
7
|
+
## 4.4.5 — 2022-01-20
|
|
8
|
+
* [Fixed][iOS] Regression bug in iOS SAS authorization strategy
|
|
9
|
+
* [Fixed][Android] Android logger defaulting to LOG_LEVEL_VERBOSE when initially launched configured for LOG_LEVEL_OFF
|
|
10
|
+
* [Changed][iOS] Rebuild with latest XCode `13.2.1`
|
|
11
|
+
|
|
12
|
+
## 4.4.4 — 2021-11-11
|
|
13
|
+
* [Fixed][iOS] More issues with iOS plugin 'invalidate' method. Get rid of this method. Implement startObserving, stopObserving.
|
|
14
|
+
|
|
15
|
+
## 4.4.3 — 2021-11-10
|
|
16
|
+
* [Fixed][iOS] Backwards compatibility issue: react-native@0.66 does have this method. `No visible @interface for 'RCTEventEmitter' declares the selector 'invalidate' in RNBackgroundGeolocation.m`.
|
|
17
|
+
|
|
3
18
|
## 4.4.2 — 2021-10-29
|
|
4
19
|
* [Fixed][Android] Android 12 behaviour changes mean that foreground-services remain running. When an Android app is terminated, the app process does not terminate (since the foreground-service is active) and `RNBackgroundGeolocationModule` remains in memory. Given that, the plugin cannot rely on registering its event-listeners in the `RNBackgroundGeolocationModule` constructor, but must perform that task when `.ready()` is called. This also requires resetting `mReady = false` when the `MainActivity` is destroyed, so that the next time `.ready()` is called, the event-listeners are re-registered.
|
|
5
20
|
* [Fixed][Android] When `.ready()` is called __`reset: false`__, the `success` callback was not invoked with the current `State`. This bug was introduced in previous `v4.4.1`.
|
package/README.md
CHANGED
|
@@ -29,6 +29,7 @@ The **[Android module](http://www.transistorsoft.com/shop/products/react-native-
|
|
|
29
29
|

|
|
30
30
|
|
|
31
31
|
# Contents
|
|
32
|
+
- ### 😫 [Help!](../../wiki/Help)
|
|
32
33
|
- ### :books: [API Documentation](https://transistorsoft.github.io/react-native-background-geolocation)
|
|
33
34
|
- ### [Installing the Plugin](#large_blue_diamond-installing-the-plugin)
|
|
34
35
|
- ### [Setup Guides](#large_blue_diamond-setup-guides)
|
|
@@ -136,40 +137,77 @@ For more information, see [this blog post](https://medium.com/@transistorsoft/ne
|
|
|
136
137
|
|
|
137
138
|
There are three main steps to using `BackgroundGeolocation`
|
|
138
139
|
1. Wire up event-listeners.
|
|
139
|
-
2.
|
|
140
|
-
3.
|
|
140
|
+
2. `.ready(config)` the plugin.
|
|
141
|
+
3. `.start()` the plugin.
|
|
142
|
+
|
|
143
|
+
:warning: Do not execute *any* API method which will require accessing location-services until the **`.ready(config)`** method resolves (eg: `#getCurrentPosition`, `#watchPosition`, `#start`).
|
|
141
144
|
|
|
142
145
|
```javascript
|
|
143
|
-
//
|
|
144
|
-
|
|
146
|
+
// NO! .ready() has not resolved.
|
|
147
|
+
BackgroundGeolocation.getCurrentPosition(options);
|
|
148
|
+
BackgroundGeolocation.start();
|
|
149
|
+
|
|
150
|
+
BackgroundGeolocation.ready(config).then((state) => {
|
|
151
|
+
// YES -- .ready() has now resolved.
|
|
152
|
+
BackgroundGeolocation.getCurrentPosition(options);
|
|
153
|
+
BackgroundGeolocation.start();
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
// NO! .ready() has not resolved.
|
|
157
|
+
BackgroundGeolocation.getCurrentPosition(options);
|
|
158
|
+
BackgroundGeolocation.start();
|
|
159
|
+
```
|
|
145
160
|
|
|
146
|
-
export default class App extends Component {
|
|
147
|
-
componentWillMount() {
|
|
148
|
-
////
|
|
149
|
-
// 1. Wire up event-listeners
|
|
150
|
-
//
|
|
151
161
|
|
|
152
|
-
|
|
153
|
-
BackgroundGeolocation.onLocation(this.onLocation, this.onError);
|
|
162
|
+
### Example 1. — React *Functional Component*
|
|
154
163
|
|
|
155
|
-
|
|
156
|
-
|
|
164
|
+
<details>
|
|
165
|
+
<summary>Show Source</summary>
|
|
157
166
|
|
|
158
|
-
|
|
159
|
-
|
|
167
|
+
```javascript
|
|
168
|
+
|
|
169
|
+
import React from 'react';
|
|
170
|
+
import {
|
|
171
|
+
Switch,
|
|
172
|
+
Text,
|
|
173
|
+
View,
|
|
174
|
+
} from 'react-native';
|
|
160
175
|
|
|
161
|
-
|
|
162
|
-
|
|
176
|
+
import BackgroundGeolocation, {
|
|
177
|
+
Location,
|
|
178
|
+
Subscription
|
|
179
|
+
} from "react-native-background-geolocation";
|
|
163
180
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
181
|
+
const HelloWorld = () => {
|
|
182
|
+
const [enabled, setEnabled] = React.useState(false);
|
|
183
|
+
const [location, setLocation] = React.useState('');
|
|
184
|
+
|
|
185
|
+
React.useEffect(() => {
|
|
186
|
+
/// 1. Subscribe to events.
|
|
187
|
+
const onLocation:Subscription = BackgroundGeolocation.onLocation((location) => {
|
|
188
|
+
console.log('[onLocation]', location);
|
|
189
|
+
setLocation(JSON.stringify(location, null, 2));
|
|
190
|
+
})
|
|
191
|
+
|
|
192
|
+
const onMotionChange:Subscription = BackgroundGeolocation.onMotionChange((event) => {
|
|
193
|
+
console.log('[onMotionChange]', event);
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
const onActivityChange:Subscription = BackgroundGeolocation.onActivityChange((event) => {
|
|
197
|
+
console.log('[onMotionChange]', event);
|
|
198
|
+
})
|
|
199
|
+
|
|
200
|
+
const onProviderChange:Subscription = BackgroundGeolocation.onProviderChange((event) => {
|
|
201
|
+
console.log('[onProviderChange]', event);
|
|
202
|
+
})
|
|
203
|
+
|
|
204
|
+
/// 2. ready the plugin.
|
|
167
205
|
BackgroundGeolocation.ready({
|
|
168
206
|
// Geolocation Config
|
|
169
207
|
desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
|
|
170
208
|
distanceFilter: 10,
|
|
171
209
|
// Activity Recognition
|
|
172
|
-
stopTimeout:
|
|
210
|
+
stopTimeout: 5,
|
|
173
211
|
// Application config
|
|
174
212
|
debug: true, // <-- enable this hear sounds for background-geolocation life-cycle.
|
|
175
213
|
logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
|
|
@@ -185,68 +223,178 @@ export default class App extends Component {
|
|
|
185
223
|
params: { // <-- Optional HTTP params
|
|
186
224
|
"auth_token": "maybe_your_server_authenticates_via_token_YES?"
|
|
187
225
|
}
|
|
188
|
-
}
|
|
226
|
+
}).then((state) => {
|
|
227
|
+
setEnabled(state.enabled)
|
|
189
228
|
console.log("- BackgroundGeolocation is configured and ready: ", state.enabled);
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
return () => {
|
|
232
|
+
// Remove BackgroundGeolocation event-subscribers when the View is removed or refreshed
|
|
233
|
+
// during development live-reload. Without this, event-listeners will accumulate with
|
|
234
|
+
// each refresh during live-reload.
|
|
235
|
+
onLocation.remove();
|
|
236
|
+
onMotionChange.remove();
|
|
237
|
+
onActivityChange.remove();
|
|
238
|
+
onProviderChange.remove();
|
|
239
|
+
}
|
|
240
|
+
}, []);
|
|
241
|
+
|
|
242
|
+
/// 3. start / stop BackgroundGeolocation
|
|
243
|
+
React.useEffect(() => {
|
|
244
|
+
if (enabled) {
|
|
245
|
+
BackgroundGeolocation.start();
|
|
246
|
+
} else {
|
|
247
|
+
BackgroundGeolocation.stop();
|
|
248
|
+
setLocation('');
|
|
249
|
+
}
|
|
250
|
+
}, [enabled]);
|
|
251
|
+
|
|
252
|
+
return (
|
|
253
|
+
<View style={{alignItems:'center'}}>
|
|
254
|
+
<Text>Click to enable BackgroundGeolocation</Text>
|
|
255
|
+
<Switch value={enabled} onValueChange={setEnabled} />
|
|
256
|
+
<Text style={{fontFamily:'monospace', fontSize:12}}>{location}</Text>
|
|
257
|
+
</View>
|
|
258
|
+
)
|
|
259
|
+
}
|
|
190
260
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
261
|
+
export default HelloWorld;
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
</details>
|
|
265
|
+
|
|
266
|
+
### Example 2. — React *Class Component*
|
|
267
|
+
|
|
268
|
+
<details>
|
|
269
|
+
<summary>Show Source</summary>
|
|
270
|
+
|
|
271
|
+
```javascript
|
|
272
|
+
import React from 'react';
|
|
273
|
+
import {
|
|
274
|
+
Switch,
|
|
275
|
+
Text,
|
|
276
|
+
View,
|
|
277
|
+
} from 'react-native';
|
|
278
|
+
|
|
279
|
+
import BackgroundGeolocation, {
|
|
280
|
+
Location,
|
|
281
|
+
Subscription
|
|
282
|
+
} from "react-native-background-geolocation";
|
|
283
|
+
|
|
284
|
+
export default class HelloWorld extends React.Component {
|
|
285
|
+
subscriptions:Subscription[] = [];
|
|
286
|
+
state:any = {};
|
|
287
|
+
constructor(props:any) {
|
|
288
|
+
super(props);
|
|
289
|
+
this.state = {
|
|
290
|
+
enabled: false,
|
|
291
|
+
location: ''
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
componentDidMount() {
|
|
296
|
+
/// 1. Subscribe to BackgroundGeolocation events.
|
|
297
|
+
this.subscriptions.push(BackgroundGeolocation.onLocation((location) => {
|
|
298
|
+
console.log('[onLocation]', location);
|
|
299
|
+
this.setState({location: JSON.stringify(location, null, 2)})
|
|
300
|
+
}, (error) => {
|
|
301
|
+
console.log('[onLocation] ERROR:', error);
|
|
302
|
+
}))
|
|
303
|
+
|
|
304
|
+
this.subscriptions.push(BackgroundGeolocation.onMotionChange((event) => {
|
|
305
|
+
console.log('[onMotionChange]', event);
|
|
306
|
+
}))
|
|
307
|
+
|
|
308
|
+
this.subscriptions.push(BackgroundGeolocation.onActivityChange((event) => {
|
|
309
|
+
console.log('[onActivityChange]', event);
|
|
310
|
+
}))
|
|
311
|
+
|
|
312
|
+
this.subscriptions.push(BackgroundGeolocation.onProviderChange((event) => {
|
|
313
|
+
console.log('[onProviderChange]', event);
|
|
314
|
+
}))
|
|
315
|
+
|
|
316
|
+
/// 2. ready the plugin.
|
|
317
|
+
BackgroundGeolocation.ready({
|
|
318
|
+
// Geolocation Config
|
|
319
|
+
desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
|
|
320
|
+
distanceFilter: 10,
|
|
321
|
+
// Activity Recognition
|
|
322
|
+
stopTimeout: 5,
|
|
323
|
+
// Application config
|
|
324
|
+
debug: true, // <-- enable this hear sounds for background-geolocation life-cycle.
|
|
325
|
+
logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE,
|
|
326
|
+
stopOnTerminate: false, // <-- Allow the background-service to continue tracking when user closes the app.
|
|
327
|
+
startOnBoot: true, // <-- Auto start tracking when device is powered-up.
|
|
328
|
+
// HTTP / SQLite config
|
|
329
|
+
url: 'http://yourserver.com/locations',
|
|
330
|
+
batchSync: false, // <-- [Default: false] Set true to sync locations to server in a single HTTP request.
|
|
331
|
+
autoSync: true, // <-- [Default: true] Set true to sync each location to server as it arrives.
|
|
332
|
+
headers: { // <-- Optional HTTP headers
|
|
333
|
+
"X-FOO": "bar"
|
|
334
|
+
},
|
|
335
|
+
params: { // <-- Optional HTTP params
|
|
336
|
+
"auth_token": "maybe_your_server_authenticates_via_token_YES?"
|
|
198
337
|
}
|
|
199
|
-
})
|
|
338
|
+
}).then((state) => {
|
|
339
|
+
this.setState({enabled: state.enabled});
|
|
340
|
+
console.log("- BackgroundGeolocation is configured and ready: ", state.enabled);
|
|
341
|
+
})
|
|
200
342
|
}
|
|
201
343
|
|
|
202
|
-
|
|
344
|
+
/// When view is destroyed (or refreshed during development live-reload),
|
|
345
|
+
/// remove BackgroundGeolocation event subscriptions.
|
|
203
346
|
componentWillUnmount() {
|
|
204
|
-
|
|
205
|
-
}
|
|
206
|
-
onLocation(location) {
|
|
207
|
-
console.log('[location] -', location);
|
|
208
|
-
}
|
|
209
|
-
onError(error) {
|
|
210
|
-
console.warn('[location] ERROR -', error);
|
|
211
|
-
}
|
|
212
|
-
onActivityChange(event) {
|
|
213
|
-
console.log('[activitychange] -', event); // eg: 'on_foot', 'still', 'in_vehicle'
|
|
347
|
+
this.subscriptions.forEach((subscription) => subscription.remove());
|
|
214
348
|
}
|
|
215
|
-
|
|
216
|
-
|
|
349
|
+
|
|
350
|
+
onToggleEnabled(value:boolean) {
|
|
351
|
+
console.log('[onToggleEnabled]', value);
|
|
352
|
+
this.setState({enabled: value})
|
|
353
|
+
if (value) {
|
|
354
|
+
BackgroundGeolocation.start();
|
|
355
|
+
} else {
|
|
356
|
+
this.setState({location: ''});
|
|
357
|
+
BackgroundGeolocation.stop();
|
|
358
|
+
}
|
|
217
359
|
}
|
|
218
|
-
|
|
219
|
-
|
|
360
|
+
|
|
361
|
+
render() {
|
|
362
|
+
return (
|
|
363
|
+
<View style={{alignItems:'center'}}>
|
|
364
|
+
<Text>Click to enable BackgroundGeolocation</Text>
|
|
365
|
+
<Switch value={this.state.enabled} onValueChange={this.onToggleEnabled.bind(this)} />
|
|
366
|
+
<Text style={{fontFamily:'monospace', fontSize:12}}>{this.state.location}</Text>
|
|
367
|
+
</View>
|
|
368
|
+
)
|
|
220
369
|
}
|
|
221
370
|
}
|
|
222
|
-
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
```javascript
|
|
226
|
-
BackgroundGeolocation.ready({
|
|
227
|
-
reset: true, // <-- true to always apply the supplied config
|
|
228
|
-
distanceFilter: 10
|
|
229
|
-
}, (state) => {
|
|
230
|
-
console.log('- BackgroundGeolocation is ready: ', state);
|
|
231
|
-
});
|
|
232
371
|
```
|
|
233
|
-
|
|
234
|
-
:warning: Do not execute *any* API method which will require accessing location-services until the callback to **`#ready`** executes (eg: `#getCurrentPosition`, `#watchPosition`, `#start`).
|
|
372
|
+
</details>
|
|
235
373
|
|
|
236
374
|
### Promise API
|
|
237
375
|
|
|
238
|
-
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 **`#
|
|
376
|
+
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 **`#onXXX`** method (eg: `onLocation`). For more information, see the [API Documentation](https://transistorsoft.github.io/react-native-background-geolocation-android)
|
|
239
377
|
|
|
240
378
|
```javascript
|
|
241
|
-
// Traditional API still works:
|
|
242
379
|
BackgroundGeolocation.ready({
|
|
243
|
-
desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
|
|
380
|
+
desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
|
|
244
381
|
distanceFilter: 50
|
|
245
382
|
}).then(state => {
|
|
246
383
|
console.log('- BackgroundGeolocation is ready: ', state);
|
|
247
384
|
}).catch(error => {
|
|
248
|
-
console.
|
|
385
|
+
console.warn('- BackgroundGeolocation error: ', error);
|
|
249
386
|
});
|
|
387
|
+
|
|
388
|
+
// Or use await in an async function
|
|
389
|
+
try {
|
|
390
|
+
const state = await BackgroundGeolocation.ready({
|
|
391
|
+
desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH,
|
|
392
|
+
distanceFilter: 50
|
|
393
|
+
})
|
|
394
|
+
console.log('- BackgroundGeolocation is ready: ', state);
|
|
395
|
+
} catch (error) {
|
|
396
|
+
console.warn('- BackgroundGeolocation error: ', error);
|
|
397
|
+
}
|
|
250
398
|
```
|
|
251
399
|
|
|
252
400
|
## :large_blue_diamond: [Demo Application](https://github.com/transistorsoft/rn-background-geolocation-demo)
|
|
Binary file
|
package/android/libs/com/transistorsoft/tslocationmanager/3.1.37/tslocationmanager-3.1.37.aar.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
94509245b59beba1eef5ad6c797a7300
|
package/android/libs/com/transistorsoft/tslocationmanager/3.1.37/tslocationmanager-3.1.37.aar.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1bc15ddbd5a4ac5fe890df974f189d948c8dee51
|
package/android/libs/com/transistorsoft/tslocationmanager/3.1.37/tslocationmanager-3.1.37.aar.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
5560bd00493c2cb1aa3e935646b17259e2824fc05d64f78173de7a2e38fd038f
|
package/android/libs/com/transistorsoft/tslocationmanager/3.1.37/tslocationmanager-3.1.37.aar.sha512
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3ded320caece5a52e284c933eed8650652f74a27bd6fccb0de4f9ce5c40d7009c4aa9224b71e3af376660139703f92cc43663a759894986153aae0efe5ab53cf
|
package/android/libs/com/transistorsoft/tslocationmanager/3.1.37/tslocationmanager-3.1.37.pom.md5
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1287cb6ffc74386746c02bb39aec8582
|
package/android/libs/com/transistorsoft/tslocationmanager/3.1.37/tslocationmanager-3.1.37.pom.sha1
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
c1ec3da7e690679d535310d8632fcde68dcf93c5
|
package/android/libs/com/transistorsoft/tslocationmanager/3.1.37/tslocationmanager-3.1.37.pom.sha256
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
803287cc3ec4f189c68984f298bac22bcf603960fcaf6eb62f90f1a34d2c8f22
|
package/android/libs/com/transistorsoft/tslocationmanager/3.1.37/tslocationmanager-3.1.37.pom.sha512
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
619f2409676fc88ef2fc333e81a7ff17e454bff6ff9c5908c98ae227db697f65050eb453ac0a9075aa58404ae810cd8f97013fe86526fed872004038241bd7d9
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
<groupId>com.transistorsoft</groupId>
|
|
4
4
|
<artifactId>tslocationmanager</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>3.1.
|
|
7
|
-
<release>3.1.
|
|
6
|
+
<latest>3.1.37</latest>
|
|
7
|
+
<release>3.1.37</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>3.1.
|
|
10
|
-
<version>3.1.
|
|
11
|
-
<version>3.1.
|
|
9
|
+
<version>3.1.35</version>
|
|
10
|
+
<version>3.1.36</version>
|
|
11
|
+
<version>3.1.37</version>
|
|
12
12
|
</versions>
|
|
13
|
-
<lastUpdated>
|
|
13
|
+
<lastUpdated>20220329142224</lastUpdated>
|
|
14
14
|
</versioning>
|
|
15
15
|
</metadata>
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
e25af69d618ce983f405323fe25048d9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a3c31969674ef2fc190f35c97f5c36e4d23011d9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a7760ae3818c0327344e0f63a66f3fe6950897584b10f92eed0a237adc576451
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ff7bc0ea6f82304e562f3f97fb77f0f6f52a0abcf34bf4b9731141ec9934e645386d453578efa5b574f0397541eaa8cfa747e87f7aaa350ea57e4fc6eb8be7bc
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
46b90e28023f4a9216f2495d95fdf267
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
26d3a52cc07d8ef9fa19c867cbf19416fe179b05
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1af3d6787fa6cc6c11da3d70b3f61786811241ece6e4d5769af9bec64538f0ab
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
231e43be69dc269fb2bf44240427279515680b8c9121a2f6c0225465995c0407ee6bae6d290da919066c1da5ede684f19c188add8bbcf510ea2aa5b18f80deef
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
<groupId>com.transistorsoft</groupId>
|
|
4
4
|
<artifactId>tslocationmanager-reverse</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>3.1.
|
|
7
|
-
<release>3.1.
|
|
6
|
+
<latest>3.1.37</latest>
|
|
7
|
+
<release>3.1.37</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>3.1.
|
|
10
|
-
<version>3.1.
|
|
11
|
-
<version>3.1.
|
|
9
|
+
<version>3.1.35</version>
|
|
10
|
+
<version>3.1.36</version>
|
|
11
|
+
<version>3.1.37</version>
|
|
12
12
|
</versions>
|
|
13
|
-
<lastUpdated>
|
|
13
|
+
<lastUpdated>20220329142224</lastUpdated>
|
|
14
14
|
</versioning>
|
|
15
15
|
</metadata>
|
|
@@ -659,13 +659,13 @@ RCT_EXPORT_METHOD(playSound:(int)soundId)
|
|
|
659
659
|
[self sendEventWithName:event body:body];
|
|
660
660
|
}
|
|
661
661
|
|
|
662
|
-
- (void)
|
|
663
|
-
|
|
664
|
-
[
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
662
|
+
- (void) startObserving {
|
|
663
|
+
// TODO Could possibly execute [self registerEventListeners] here.
|
|
664
|
+
[locationManager log:@"info" message:@"[RNBackgroundGeolocation startObserving]"];
|
|
665
|
+
}
|
|
666
|
+
- (void) stopObserving {
|
|
667
|
+
// TODO Could possibly execute [locationManager removeListeners] here.
|
|
668
|
+
[locationManager log:@"info" message:@"[RNBackgroundGeolocation stopObserving]"];
|
|
669
669
|
}
|
|
670
670
|
|
|
671
671
|
- (void)dealloc
|
|
@@ -6,47 +6,47 @@
|
|
|
6
6
|
<array>
|
|
7
7
|
<dict>
|
|
8
8
|
<key>LibraryIdentifier</key>
|
|
9
|
-
<string>ios-
|
|
9
|
+
<string>ios-arm64_armv7</string>
|
|
10
10
|
<key>LibraryPath</key>
|
|
11
11
|
<string>TSLocationManager.framework</string>
|
|
12
12
|
<key>SupportedArchitectures</key>
|
|
13
13
|
<array>
|
|
14
14
|
<string>arm64</string>
|
|
15
|
-
<string>
|
|
16
|
-
<string>x86_64</string>
|
|
15
|
+
<string>armv7</string>
|
|
17
16
|
</array>
|
|
18
17
|
<key>SupportedPlatform</key>
|
|
19
18
|
<string>ios</string>
|
|
20
|
-
<key>SupportedPlatformVariant</key>
|
|
21
|
-
<string>simulator</string>
|
|
22
19
|
</dict>
|
|
23
20
|
<dict>
|
|
24
21
|
<key>LibraryIdentifier</key>
|
|
25
|
-
<string>ios-
|
|
22
|
+
<string>ios-arm64_i386_x86_64-simulator</string>
|
|
26
23
|
<key>LibraryPath</key>
|
|
27
24
|
<string>TSLocationManager.framework</string>
|
|
28
25
|
<key>SupportedArchitectures</key>
|
|
29
26
|
<array>
|
|
30
27
|
<string>arm64</string>
|
|
28
|
+
<string>i386</string>
|
|
31
29
|
<string>x86_64</string>
|
|
32
30
|
</array>
|
|
33
31
|
<key>SupportedPlatform</key>
|
|
34
32
|
<string>ios</string>
|
|
35
33
|
<key>SupportedPlatformVariant</key>
|
|
36
|
-
<string>
|
|
34
|
+
<string>simulator</string>
|
|
37
35
|
</dict>
|
|
38
36
|
<dict>
|
|
39
37
|
<key>LibraryIdentifier</key>
|
|
40
|
-
<string>ios-
|
|
38
|
+
<string>ios-arm64_x86_64-maccatalyst</string>
|
|
41
39
|
<key>LibraryPath</key>
|
|
42
40
|
<string>TSLocationManager.framework</string>
|
|
43
41
|
<key>SupportedArchitectures</key>
|
|
44
42
|
<array>
|
|
45
43
|
<string>arm64</string>
|
|
46
|
-
<string>
|
|
44
|
+
<string>x86_64</string>
|
|
47
45
|
</array>
|
|
48
46
|
<key>SupportedPlatform</key>
|
|
49
47
|
<string>ios</string>
|
|
48
|
+
<key>SupportedPlatformVariant</key>
|
|
49
|
+
<string>maccatalyst</string>
|
|
50
50
|
</dict>
|
|
51
51
|
</array>
|
|
52
52
|
<key>CFBundlePackageType</key>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<plist version="1.0">
|
|
4
4
|
<dict>
|
|
5
5
|
<key>BuildMachineOSBuild</key>
|
|
6
|
-
<string>
|
|
6
|
+
<string>21C52</string>
|
|
7
7
|
<key>CFBundleDevelopmentRegion</key>
|
|
8
8
|
<string>en</string>
|
|
9
9
|
<key>CFBundleExecutable</key>
|
|
@@ -17,29 +17,29 @@
|
|
|
17
17
|
<key>CFBundlePackageType</key>
|
|
18
18
|
<string>FMWK</string>
|
|
19
19
|
<key>CFBundleShortVersionString</key>
|
|
20
|
-
<string>4.
|
|
20
|
+
<string>4.1.2</string>
|
|
21
21
|
<key>CFBundleSupportedPlatforms</key>
|
|
22
22
|
<array>
|
|
23
23
|
<string>MacOSX</string>
|
|
24
24
|
</array>
|
|
25
25
|
<key>CFBundleVersion</key>
|
|
26
|
-
<string>
|
|
26
|
+
<string>384</string>
|
|
27
27
|
<key>DTCompiler</key>
|
|
28
28
|
<string>com.apple.compilers.llvm.clang.1_0</string>
|
|
29
29
|
<key>DTPlatformBuild</key>
|
|
30
|
-
<string>
|
|
30
|
+
<string>13C100</string>
|
|
31
31
|
<key>DTPlatformName</key>
|
|
32
32
|
<string>macosx</string>
|
|
33
33
|
<key>DTPlatformVersion</key>
|
|
34
|
-
<string>
|
|
34
|
+
<string>12.1</string>
|
|
35
35
|
<key>DTSDKBuild</key>
|
|
36
|
-
<string>
|
|
36
|
+
<string>21C46</string>
|
|
37
37
|
<key>DTSDKName</key>
|
|
38
|
-
<string>
|
|
38
|
+
<string>macosx12.1</string>
|
|
39
39
|
<key>DTXcode</key>
|
|
40
|
-
<string>
|
|
40
|
+
<string>1321</string>
|
|
41
41
|
<key>DTXcodeBuild</key>
|
|
42
|
-
<string>
|
|
42
|
+
<string>13C100</string>
|
|
43
43
|
<key>LSMinimumSystemVersion</key>
|
|
44
44
|
<string>10.15</string>
|
|
45
45
|
<key>UIDeviceFamily</key>
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-background-geolocation",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.6",
|
|
4
4
|
"description": "The most sophisticated cross-platform background location-tracking & geofencing module with battery-conscious motion-detection intelligence",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1"
|
package/android/libs/com/transistorsoft/tslocationmanager/3.1.34/tslocationmanager-3.1.34.aar.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
b29e51d5d171bd1836954c83f1657dd3
|
package/android/libs/com/transistorsoft/tslocationmanager/3.1.34/tslocationmanager-3.1.34.aar.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
738f4f927fde78332eeeb300ca1ac2ffbe6ddc26
|
package/android/libs/com/transistorsoft/tslocationmanager/3.1.34/tslocationmanager-3.1.34.aar.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
a3dd1567edc75edbf1feb8bc3682d5e02ded8605e49854ba3169f391bfc8d09f
|
package/android/libs/com/transistorsoft/tslocationmanager/3.1.34/tslocationmanager-3.1.34.aar.sha512
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
8d405b0427fd37b225dd4ca90633614371c994f4e1fa2ada7c453a067c08ebc9f7b41b1ebfe13f09bafacfa948385b3a27b6964e3936ecb4e822c184603afe58
|
package/android/libs/com/transistorsoft/tslocationmanager/3.1.34/tslocationmanager-3.1.34.pom.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
20aafcf94ea9673cc521f064d46ade7b
|
package/android/libs/com/transistorsoft/tslocationmanager/3.1.34/tslocationmanager-3.1.34.pom.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
008bd7362c4446af36bef9e156b6c702a7e3b781
|
package/android/libs/com/transistorsoft/tslocationmanager/3.1.34/tslocationmanager-3.1.34.pom.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
5dc8c142d50c9e6c9986a1b3d374e9ed86427da743e4030d24c45c9c0c4c2fdf
|
package/android/libs/com/transistorsoft/tslocationmanager/3.1.34/tslocationmanager-3.1.34.pom.sha512
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
d8d251199fbd1fa61abcb4bf82b4e67624d82fc03fb34d114b10d99bcf4e5d443f65e38e16620a0020c566d844a51e600f4f5aa073c754a4ac2824210ba30498
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
c18e72e1b8a4706f760959f59a0d918c
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2e0c81175a1b44c05be8dbf607d65886d402f656
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
649f4c006732c5b2a04b6f90fba952377fa7281dda7374a20f5c67661439b45f
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
cfa5f14f859d2bd881867cc63b1968a7527b5a7e8082b551d3e3ad854783fcadefd9f2e21f2071201e1570347348cf4355e5d74c2049a1af4f21c1cca8c208f7
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
103b24060fe7ea19fe001a12852489b4
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
fbb3841eba4fdd2ffbb024d1a791abe6eb15533b
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
e6ebe3816a4c6ddb141b433b631e4e00c67adec24e46e45d0f06279cc0677e4f
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
f4c9c0482e0b822dcca71dcc32eaa5ee3a0caa93e0936e13e1ae38fb53f0b3137125b7cd90ff0469e53bb88caf961955972dc86a442dc2d937ae826a156df7f1
|