react-native-background-geolocation 5.0.1 → 5.0.3
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/.vscode/settings.json +3 -0
- package/RNBackgroundGeolocation.podspec +1 -1
- package/android/build.gradle +2 -2
- package/android/src/main/java/com/transistorsoft/rnbackgroundgeolocation/RNBackgroundGeolocationModule.java +3 -15
- package/ios/RNBackgroundGeolocation/RNBackgroundGeolocation.mm +1 -1
- package/package.json +1 -1
- package/src/Logger.js +6 -18
- package/src/NativeModule.js +13 -10
- package/src/native/specs/NativeBackgroundGeolocation.ts +4 -4
- package/android/.settings/org.eclipse.buildship.core.prefs +0 -13
|
@@ -27,7 +27,7 @@ Pod::Spec.new do |s|
|
|
|
27
27
|
s.preserve_paths = 'docs', 'CHANGELOG.md', 'LICENSE', 'package.json', 'RNBackgroundGeolocation.ios.js'
|
|
28
28
|
|
|
29
29
|
s.dependency 'CocoaLumberjack', '~> 3.8.5'
|
|
30
|
-
s.dependency 'TSLocationManager', '~> 4.0.
|
|
30
|
+
s.dependency 'TSLocationManager', '~> 4.0.10'
|
|
31
31
|
|
|
32
32
|
s.libraries = 'sqlite3', 'z', 'stdc++'
|
|
33
33
|
s.resource_bundles = {
|
package/android/build.gradle
CHANGED
|
@@ -4,8 +4,8 @@ plugins {
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
// Android dependencies
|
|
7
|
-
def DEFAULT_COMPILE_SDK_VERSION =
|
|
8
|
-
def DEFAULT_TARGET_SDK_VERSION =
|
|
7
|
+
def DEFAULT_COMPILE_SDK_VERSION = 35
|
|
8
|
+
def DEFAULT_TARGET_SDK_VERSION = 35
|
|
9
9
|
|
|
10
10
|
// Plugin dependencies
|
|
11
11
|
def DEFAULT_PLAY_SERVICES_LOCATION_VERSION = "21.3.0"
|
|
@@ -326,18 +326,13 @@ public class RNBackgroundGeolocationModule
|
|
|
326
326
|
|
|
327
327
|
@Override
|
|
328
328
|
public void onHostPause() {
|
|
329
|
-
|
|
330
|
-
TSConfig config = TSConfig.getInstance(context);
|
|
331
|
-
if (config.getEnabled()) {
|
|
332
|
-
TSScheduleManager.getInstance(context).oneShot(TerminateEvent.ACTION, 10000);
|
|
333
|
-
}
|
|
329
|
+
|
|
334
330
|
}
|
|
335
331
|
@Override
|
|
336
332
|
public void onHostDestroy() {
|
|
337
333
|
mInitialized = false;
|
|
338
334
|
mReady = false;
|
|
339
335
|
removeAllListeners();
|
|
340
|
-
getAdapter().onActivityDestroy();
|
|
341
336
|
}
|
|
342
337
|
|
|
343
338
|
@Override
|
|
@@ -1017,8 +1012,7 @@ public class RNBackgroundGeolocationModule
|
|
|
1017
1012
|
private void removeAllListeners() {
|
|
1018
1013
|
synchronized (mListeners) {
|
|
1019
1014
|
mListeners.clear();
|
|
1020
|
-
}
|
|
1021
|
-
getAdapter().removeListeners();
|
|
1015
|
+
}
|
|
1022
1016
|
}
|
|
1023
1017
|
|
|
1024
1018
|
private void onLocationError(Integer code) {
|
|
@@ -1274,11 +1268,5 @@ public class RNBackgroundGeolocationModule
|
|
|
1274
1268
|
|
|
1275
1269
|
private BackgroundGeolocation getAdapter() {
|
|
1276
1270
|
return BackgroundGeolocation.getInstance(getReactApplicationContext());
|
|
1277
|
-
}
|
|
1278
|
-
|
|
1279
|
-
@Override
|
|
1280
|
-
public void onCatalystInstanceDestroy() {
|
|
1281
|
-
mInitialized = false;
|
|
1282
|
-
removeAllListeners();
|
|
1283
|
-
}
|
|
1271
|
+
}
|
|
1284
1272
|
}
|
|
@@ -363,7 +363,7 @@ RCT_EXPORT_METHOD(getCurrentPosition:(NSDictionary*)options resolve:(RCTPromiseR
|
|
|
363
363
|
RCT_EXPORT_METHOD(watchPosition:(NSDictionary*)options resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject)
|
|
364
364
|
{
|
|
365
365
|
TSWatchPositionRequest *request = [TSWatchPositionRequest requestWithSuccess:^(TSLocationStreamEvent *event) {
|
|
366
|
-
[self sendEvent:EVENT_WATCHPOSITION body:[event toDictionary]];
|
|
366
|
+
[self sendEvent:EVENT_WATCHPOSITION body:[event.locationEvent toDictionary]];
|
|
367
367
|
} failure:^(NSError *error) {
|
|
368
368
|
// No reject; stream API
|
|
369
369
|
}];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
|
|
3
3
|
"name": "react-native-background-geolocation",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.3",
|
|
5
5
|
"description": "The most sophisticated cross-platform background location-tracking & geofencing module with battery-conscious motion-detection intelligence",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "yarn run build:expo",
|
package/src/Logger.js
CHANGED
|
@@ -13,19 +13,7 @@ const ORDER_ASC = 1;
|
|
|
13
13
|
const ORDER_DESC = -1;
|
|
14
14
|
|
|
15
15
|
function log(level, msg) {
|
|
16
|
-
|
|
17
|
-
// fallback to debug if missing.
|
|
18
|
-
if (
|
|
19
|
-
NativeModule.logger &&
|
|
20
|
-
typeof NativeModule.logger[level] === 'function'
|
|
21
|
-
) {
|
|
22
|
-
NativeModule.logger[level](msg);
|
|
23
|
-
} else if (
|
|
24
|
-
NativeModule.logger &&
|
|
25
|
-
typeof NativeModule.logger.debug === 'function'
|
|
26
|
-
) {
|
|
27
|
-
NativeModule.logger.debug(msg);
|
|
28
|
-
}
|
|
16
|
+
return NativeModule.log(level, msg);
|
|
29
17
|
}
|
|
30
18
|
|
|
31
19
|
function validateQuery(query) {
|
|
@@ -43,11 +31,11 @@ export default class Logger {
|
|
|
43
31
|
static get ORDER_ASC() { return ORDER_ASC; }
|
|
44
32
|
static get ORDER_DESC() { return ORDER_DESC; }
|
|
45
33
|
|
|
46
|
-
static debug(msg) { log(LOG_LEVEL_DEBUG, msg); }
|
|
47
|
-
static error(msg) { log(LOG_LEVEL_ERROR, msg); }
|
|
48
|
-
static warn(msg) { log(LOG_LEVEL_WARN, msg); }
|
|
49
|
-
static info(msg) { log(LOG_LEVEL_INFO, msg); }
|
|
50
|
-
static notice(msg) { log(LOG_LEVEL_NOTICE, msg); }
|
|
34
|
+
static debug(msg) { return log(LOG_LEVEL_DEBUG, msg); }
|
|
35
|
+
static error(msg) { return log(LOG_LEVEL_ERROR, msg); }
|
|
36
|
+
static warn(msg) { return log(LOG_LEVEL_WARN, msg); }
|
|
37
|
+
static info(msg) { return log(LOG_LEVEL_INFO, msg); }
|
|
38
|
+
static notice(msg) { return log(LOG_LEVEL_NOTICE, msg); }
|
|
51
39
|
|
|
52
40
|
static getLog(query) {
|
|
53
41
|
return NativeModule.getLog(validateQuery(query));
|
package/src/NativeModule.js
CHANGED
|
@@ -51,31 +51,31 @@ const PLATFORM_IOS = "ios";
|
|
|
51
51
|
*/
|
|
52
52
|
const LOGGER = {
|
|
53
53
|
error: function(msg) {
|
|
54
|
-
RNBackgroundGeolocation.log('error', msg);
|
|
54
|
+
return RNBackgroundGeolocation.log('error', msg);
|
|
55
55
|
},
|
|
56
56
|
warn: function(msg) {
|
|
57
|
-
RNBackgroundGeolocation.log('warn', msg);
|
|
57
|
+
return RNBackgroundGeolocation.log('warn', msg);
|
|
58
58
|
},
|
|
59
59
|
debug: function(msg) {
|
|
60
|
-
RNBackgroundGeolocation.log('debug', msg);
|
|
60
|
+
return RNBackgroundGeolocation.log('debug', msg);
|
|
61
61
|
},
|
|
62
62
|
info: function(msg) {
|
|
63
|
-
RNBackgroundGeolocation.log('info', msg);
|
|
63
|
+
return RNBackgroundGeolocation.log('info', msg);
|
|
64
64
|
},
|
|
65
65
|
notice: function(msg) {
|
|
66
|
-
RNBackgroundGeolocation.log('notice', msg);
|
|
66
|
+
return RNBackgroundGeolocation.log('notice', msg);
|
|
67
67
|
},
|
|
68
68
|
header: function(msg) {
|
|
69
|
-
RNBackgroundGeolocation.log('header', msg);
|
|
69
|
+
return RNBackgroundGeolocation.log('header', msg);
|
|
70
70
|
},
|
|
71
71
|
on: function(msg) {
|
|
72
|
-
RNBackgroundGeolocation.log('on', msg);
|
|
72
|
+
return RNBackgroundGeolocation.log('on', msg);
|
|
73
73
|
},
|
|
74
74
|
off: function(msg) {
|
|
75
|
-
RNBackgroundGeolocation.log('off', msg);
|
|
75
|
+
return RNBackgroundGeolocation.log('off', msg);
|
|
76
76
|
},
|
|
77
77
|
ok: function(msg) {
|
|
78
|
-
RNBackgroundGeolocation.log('ok', msg);
|
|
78
|
+
return RNBackgroundGeolocation.log('ok', msg);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
|
|
@@ -300,7 +300,6 @@ export default class NativeModule {
|
|
|
300
300
|
let watchId;
|
|
301
301
|
try {
|
|
302
302
|
watchId = await RNBackgroundGeolocation.watchPosition(options);
|
|
303
|
-
console.log("********** watchPositonId: ", watchId)
|
|
304
303
|
// Resolve with our wrapped Subscription instance.
|
|
305
304
|
resolve({
|
|
306
305
|
id: watchId,
|
|
@@ -391,6 +390,10 @@ export default class NativeModule {
|
|
|
391
390
|
* Logging & Debug Methods
|
|
392
391
|
*/
|
|
393
392
|
|
|
393
|
+
static log(level, message) {
|
|
394
|
+
return RNBackgroundGeolocation.log(level, message);
|
|
395
|
+
}
|
|
396
|
+
|
|
394
397
|
static setLogLevel(value) {
|
|
395
398
|
return RNBackgroundGeolocation.setLogLevel(value);
|
|
396
399
|
}
|
|
@@ -43,11 +43,11 @@ export interface Spec extends TurboModule {
|
|
|
43
43
|
destroyTransistorToken(url: string): Promise<void>;
|
|
44
44
|
|
|
45
45
|
// Logging
|
|
46
|
-
log(level: string, message: string): Promise<
|
|
46
|
+
log(level: string, message: string): Promise<boolean>;
|
|
47
47
|
getLog(query: Object): Promise<string>;
|
|
48
|
-
emailLog(email: string, query: Object): Promise<
|
|
49
|
-
uploadLog(url: string, query: Object): Promise<
|
|
50
|
-
destroyLog(): Promise<
|
|
48
|
+
emailLog(email: string, query: Object): Promise<boolean>;
|
|
49
|
+
uploadLog(url: string, query: Object): Promise<boolean>;
|
|
50
|
+
destroyLog(): Promise<boolean>;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
export default TurboModuleRegistry.getEnforcing<Spec>('RNBackgroundGeolocation');
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
arguments=--init-script /var/folders/qk/r2r49k7527b6r81484vtk0g40000gn/T/db3b08fc4a9ef609cb16b96b200fa13e563f396e9bb1ed0905fdab7bc3bc513b.gradle --init-script /var/folders/qk/r2r49k7527b6r81484vtk0g40000gn/T/52cde0cfcf3e28b8b7510e992210d9614505e0911af0c190bd590d7158574963.gradle
|
|
2
|
-
auto.sync=false
|
|
3
|
-
build.scans.enabled=false
|
|
4
|
-
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(8.9))
|
|
5
|
-
connection.project.dir=
|
|
6
|
-
eclipse.preferences.version=1
|
|
7
|
-
gradle.user.home=
|
|
8
|
-
java.home=/opt/homebrew/Cellar/openjdk@17/17.0.15/libexec/openjdk.jdk/Contents/Home
|
|
9
|
-
jvm.arguments=
|
|
10
|
-
offline.mode=false
|
|
11
|
-
override.workspace.settings=true
|
|
12
|
-
show.console.view=true
|
|
13
|
-
show.executions.view=true
|