react-native-geo-activity-kit 3.0.1 → 3.0.2
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,15 +22,11 @@ class ActivityTransitionReceiver : BroadcastReceiver() {
|
|
|
22
22
|
|
|
23
23
|
Log.d("ActivityReceiver", "🏃 Motion Event: $activityType ($transitionType)")
|
|
24
24
|
|
|
25
|
-
val isMoving =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
DetectedActivity.ON_BICYCLE,
|
|
29
|
-
DetectedActivity.IN_VEHICLE -> true
|
|
30
|
-
else -> false
|
|
31
|
-
}
|
|
25
|
+
val isMoving = (event.transitionType == com.google.android.gms.location.ActivityTransition.ACTIVITY_TRANSITION_ENTER &&
|
|
26
|
+
(event.activityType == DetectedActivity.WALKING || event.activityType == DetectedActivity.IN_VEHICLE)) ||
|
|
27
|
+
(event.activityType == DetectedActivity.STILL && event.transitionType == com.google.android.gms.location.ActivityTransition.ACTIVITY_TRANSITION_EXIT)
|
|
32
28
|
|
|
33
|
-
|
|
29
|
+
|
|
34
30
|
try {
|
|
35
31
|
if (isMoving) {
|
|
36
32
|
// 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 = 300000 // Change from 30000 to 300000 (5 mins)
|
|
44
|
+
fastestInterval = 300000 // Change from 30000 to 300000
|
|
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.2",
|
|
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",
|