react-native-geo-activity-kit 3.0.2 → 3.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.
|
@@ -22,11 +22,15 @@ class ActivityTransitionReceiver : BroadcastReceiver() {
|
|
|
22
22
|
|
|
23
23
|
Log.d("ActivityReceiver", "🏃 Motion Event: $activityType ($transitionType)")
|
|
24
24
|
|
|
25
|
-
val isMoving = (event.
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
val isMoving = when(event.activityType) {
|
|
26
|
+
DetectedActivity.WALKING,
|
|
27
|
+
DetectedActivity.RUNNING,
|
|
28
|
+
DetectedActivity.ON_BICYCLE,
|
|
29
|
+
DetectedActivity.IN_VEHICLE -> true
|
|
30
|
+
else -> false
|
|
31
|
+
}
|
|
28
32
|
|
|
29
|
-
|
|
33
|
+
// --- NEW: DIRECT NATIVE CONTROL (No JS required) ---
|
|
30
34
|
try {
|
|
31
35
|
if (isMoving) {
|
|
32
36
|
// Fast Updates (30s) when moving
|
|
@@ -40,8 +40,8 @@ class LocationHelper(private val context: ReactApplicationContext) {
|
|
|
40
40
|
// -----------------------
|
|
41
41
|
|
|
42
42
|
locationRequest = LocationRequest.create().apply {
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
interval = 30000
|
|
44
|
+
fastestInterval = 30000
|
|
45
45
|
priority = Priority.PRIORITY_BALANCED_POWER_ACCURACY
|
|
46
46
|
}
|
|
47
47
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-geo-activity-kit",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "Battery-efficient location tracking with motion detection and native notifications.",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|