Closed hasan642 closed 1 month ago
10-15 14:07:26.796 26914 26914 W TSLocationManager: ⚠️ Failed to initiate motion-activity updates (ERROR CODE: 10301, ACTIVITY_IDENTIFICATION_NOT_AVAILABLE). This device does not support the Motion API due to missing sensors (eg: gyroscope, accelerometer).
Am I understanding correctly that upon seeing this notification, I need to enable tracking for such a device based on the locationUpdateInterval(distanceFilter=0)?
I have also encountered a similar issue on my Huawei device. I have completed all the steps from https://dontkillmyapp.com/, including requesting the REQUEST_IGNORE_BATTERY_OPTIMIZATIONS permission, but the tracking with distanceFilter is still not working.
did you face this issue before? @superyarik
@hasan642 no, I've just started testing with Huawei Y6p.
is working with you? @superyarik
@christocracy 1- there is any function to check if the device supports geofencing or not? 2- there is no solution for this case, such as following instructions in dontkillmyapp?
Thank you for your support.
It is known that the Geofencing api from both Huawei and Google Play Services uses the motion api internally.
It seems that Huawei's motion api remains highly inferior to that of Google Play Services and does not work when the device has no gyroscope. Hopefully Huawei fixes that in a future update to their Location Kit package.
The Motion API from Google Play Services is able to operate with just an accelerometer.
There is no solution to this. It's up to Huawei to develop a better Motion API.
Interesting note in the CHANGELOG for Huawei Location Kit, linked above:
You can control the Huawei Location Kit version using gradle ext
var hmsLocationVersion
theres is a direct function or any way in the plugin to check if the huwaui device (or device in general) support geofencing or not, please?
Not currently. I will add one.
waiting for this, thank you. @christocracy
any update in the function to check if geofencing enabled or not on the huwaui device? @christocracy
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
Your Environment
react-native -v
): 0.71.8Expected Behavior
I'm currently using the plugin for an Android Huawei device. I've added a license for Huawei, but I haven't used a valid key since I'm in a DEBUG build. While I can fetch the location successfully, geofencing doesn't seem to work.
Error Received: ⚠️ Failed to start monitoring geofences: null 10200 GEOFENCE_NOT_AVAILABLE
there is a need for a valid key in debug builds?
Actual Behavior
an error received: ⚠️ Failed to start monitoring geofences: null 10200 GEOFENCE_NOT_AVAILABLE
Steps to Reproduce
Context
I'm trying to hit an API when user enters or exist the geofencing (even when app is killed)
Debug logs
Logs
``` 10-15 14:07:17.236 26914 28518 E TSLocationManager: 10-15 14:07:17.236 26914 28518 E TSLocationManager: ╔═════════════════════════════════════════════ 10-15 14:07:17.236 26914 28518 E TSLocationManager: ║ LICENSE VALIDATION FAILURE: com.zenhr 10-15 14:07:17.236 26914 28518 E TSLocationManager: ╠═════════════════════════════════════════════ 10-15 14:07:17.236 26914 28518 E TSLocationManager: ╟─ Invalid license key: YOUR_HMS_LICENCE_KEY_HERE 10-15 14:07:17.236 26914 28518 E TSLocationManager: ╟─ BackgroundGeolocation is fully functional in DEBUG builds without a license so you can 'try before you buy'. 10-15 14:07:17.236 26914 28518 E TSLocationManager: ╚═════════════════════════════════════════════ 10-15 14:07:17.275 26914 28528 I TSLocationManager: [c.t.l.logger.LoggerFacade$a a] 10-15 14:07:17.275 26914 28528 I TSLocationManager: ╔═════════════════════════════════════════════ 10-15 14:07:17.275 26914 28528 I TSLocationManager: ║ TSLocationManager version: 3.5.1 (430) 10-15 14:07:17.275 26914 28528 I TSLocationManager: ╠═════════════════════════════════════════════ 10-15 14:07:17.275 26914 28528 I TSLocationManager: ╟─ HUAWEI JNY-LX1 @ 10 (react) 10-15 14:07:17.275 26914 28528 I TSLocationManager: ╟─ HMS: true 10-15 14:07:17.275 26914 28528 I TSLocationManager: { 10-15 14:07:17.275 26914 28528 I TSLocationManager: "activityRecognitionInterval": 10000, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "allowIdenticalLocations": false, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "authorization": {}, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "autoSync": true, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "autoSyncThreshold": 0, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "backgroundPermissionRationale": { 10-15 14:07:17.275 26914 28528 I TSLocationManager: "title": "Allow {applicationName} to access this device's location even when closed or not in use?", 10-15 14:07:17.275 26914 28528 I TSLocationManager: "message": "ZenHR collect your location in background to enable auto-clocking feature", 10-15 14:07:17.275 26914 28528 I TSLocationManager: "positiveAction": "Change to \"{backgroundPermissionOptionLabel}\"", 10-15 14:07:17.275 26914 28528 I TSLocationManager: "negativeAction": "" 10-15 14:07:17.275 26914 28528 I TSLocationManager: }, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "batchSync": false, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "configUrl": "", 10-15 14:07:17.275 26914 28528 I TSLocationManager: "debug": true, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "deferTime": 0, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "desiredAccuracy": -1, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "desiredOdometerAccuracy": 100, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "disableAutoSyncOnCellular": false, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "disableElasticity": false, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "disableLocationAuthorizationAlert": true, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "disableMotionActivityUpdates": false, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "disableProviderChangeRecord": false, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "disableStopDetection": false, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "distanceFilter": 10, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "elasticityMultiplier": 1, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "enableHeadless": true, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "enableTimestampMeta": false, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "extras": {}, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "fastestLocationUpdateInterval": -1, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "foregroundService": true, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "geofenceInitialTriggerEntry": true, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "geofenceModeHighAccuracy": true, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "geofenceProximityRadius": 1000, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "geofenceTemplate": "", 10-15 14:07:17.275 26914 28528 I TSLocationManager: "headers": {}, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "headlessJobService": "com.transistorsoft.rnbackgroundgeolocation.HeadlessTask", 10-15 14:07:17.275 26914 28528 I TSLocationManager: "heartbeatInterval": -1, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "httpRootProperty": "location", 10-15 14:07:17.275 26914 28528 I TSLocationManager: "httpTimeout": 60000, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "isMoving": false, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "locationAuthorizationRequest": "Always", 10-15 14:07:17.275 26914 28528 I TSLocationManager: "locationTemplate": "", 10-15 14:07:17.275 26914 28528 I TSLocationManager: "locationTimeout": 60, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "locationUpdateInterval": 1000, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "locationsOrderDirection": "ASC", 10-15 14:07:17.275 26914 28528 I TSLocationManager: "logLevel": 5, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "logMaxDays": 0, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "maxBatchSize": -1, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "maxDaysToPersist": 0, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "maxMonitoredGeofences": 97, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "maxRecordsToPersist": 0, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "method": "POST", 10-15 14:07:17.275 26914 28528 I TSLocationManager: "minimumActivityRecognitionConfidence": 75, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "motionTriggerDelay": 0, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "notification": { 10-15 14:07:17.275 26914 28528 I TSLocationManager: "layout": "", 10-15 14:07:17.275 26914 28528 I TSLocationManager: "title": "Geofence Time-Tracking", 10-15 14:07:17.275 26914 28528 I TSLocationManager: "text": "Your work location is currently being monitored for attendance purposes.", 10-15 14:07:17.275 26914 28528 I TSLocationManager: "color": "", 10-15 14:07:17.275 26914 28528 I TSLocationManager: "channelName": "TSLocationManager", 10-15 14:07:17.275 26914 28528 I TSLocationManager: "channelId": "", 10-15 14:07:17.275 26914 28528 I TSLocationManager: "smallIcon": "", 10-15 14:07:17.275 26914 28528 I TSLocationManager: "largeIcon": "", 10-15 14:07:17.275 26914 28528 I TSLocationManager: "priority": -1, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "sticky": false, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "strings": {}, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "actions": [] 10-15 14:07:17.275 26914 28528 I TSLocationManager: }, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "params": {}, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "persist": true, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "persistMode": -1, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "schedule": [], 10-15 14:07:17.275 26914 28528 I TSLocationManager: "scheduleUseAlarmManager": false, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "speedJumpFilter": 300, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "startOnBoot": true, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "stationaryRadius": 25, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "stopAfterElapsedMinutes": 0, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "stopOnStationary": false, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "stopOnTerminate": false, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "stopTimeout": 15, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "triggerActivities": "in_vehicle, on_bicycle, on_foot, running, walking", 10-15 14:07:17.275 26914 28528 I TSLocationManager: "url": "", 10-15 14:07:17.275 26914 28528 I TSLocationManager: "useSignificantChangesOnly": false, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "enabled": true, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "schedulerEnabled": false, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "trackingMode": 1, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "odometer": 0, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "isFirstBoot": false, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "didLaunchInBackground": false, 10-15 14:07:17.275 26914 28528 I TSLocationManager: "didDeviceReboot": false 10-15 14:07:17.275 26914 28528 I TSLocationManager: } 10-15 14:07:17.276 26914 28528 I TSLocationManager: [c.t.l.logger.LoggerFacade$a a] 10-15 14:07:17.276 26914 28528 I TSLocationManager: ╔═════════════════════════════════════════════ 10-15 14:07:17.276 26914 28528 I TSLocationManager: ║ DEVICE SENSORS 10-15 14:07:17.276 26914 28528 I TSLocationManager: ╠═════════════════════════════════════════════ 10-15 14:07:17.276 26914 28528 I TSLocationManager: ╟─ ✅ ACCELEROMETER: {Sensor name="accelerometer-lis3dh", vendor="st", version=1, type=1, maxRange=78.4532, resolution=9.576806E-6, power=0.23, minDelay=5000} 10-15 14:07:17.276 26914 28528 I TSLocationManager: ╟─ ⚠️ GYROSCOPE: none. Motion-detection system performance will be degraded 10-15 14:07:17.276 26914 28528 I TSLocationManager: ╟─ ✅ MAGNETOMETER: {Sensor name="mag-akm09918", vendor="akm", version=1, type=2, maxRange=2000.0, resolution=0.0625, power=6.8, minDelay=10000} 10-15 14:07:17.276 26914 28528 I TSLocationManager: ╟─ ✅ SIGNIFICANT_MOTION: {Sensor name="significant Motion", vendor="huawei", version=1, type=17, maxRange=2.14748365E9, resolution=1.0, power=0.23, minDelay=-1} 10-15 14:07:17.276 26914 28528 I TSLocationManager: ╚═════════════════════════════════════════════ 10-15 14:07:17.524 26914 26914 D TSLocationManager: [c.t.l.l.LifecycleManager onCreate] ☯️ onCreate 10-15 14:07:17.524 26914 26914 D TSLocationManager: [c.t.l.l.LifecycleManager onStart] ☯️ onStart 10-15 14:07:17.525 26914 26914 D TSLocationManager: [c.t.l.l.LifecycleManager onResume] ☯️ onResume 10-15 14:07:17.525 26914 26914 I TSLocationManager: [c.t.l.a.BackgroundGeolocation