Closed tushaagit closed 2 weeks ago
You'll have a hard time testing odometer with Mocked location.
Sir, This issue is not happening regularly, but get few random cases, so our km calculation logic gets disturbed, any solution for this? Can we apply any filter to avoid recording such mock locations and avoid summing up of odometer value?
This issue is not happening regularly, but get few random cases
This issue is happening because the user of that device is using a Mock location app. Of course the odometer value is going to go crazy when a mock location is detected. What do you expect the plugin to do in that case?
Sir, Its hard to guess whether he is having such app, or if you know any trick, please let us know, Also if you check the full attached log the users track and km is accurate till the evening 5:30 ist, mocking location at the day end is not of any use for that user, so i doubt why he would do so when last few minutes of his work is pending, also the users reporting person tracks that user regularly.
Sir, Its hard to guess whether he is having such app, or if you know any trick
It’s not hard to guess. Android tells me exactly when the location is being mocked. See the api docs Location.mock
yes, thanks, i had gone through that paramater, but how to restrict the location object from incrementing the odometer distance, its just an identification that mock location found, but internally the odometer is already updated
but internally the odometer is already updated
So that developers can test the odometer with mock locations.
i meant to say, there is a setting to restrict locations from updating if location accuracy > desiredAccuracy in BGeoconfig , same way is there any setting or function we can write in jquery/javascript to restrict odometer update if location mock:true
is there any setting to restrict odometer update if location mock:true
No.
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
Plugin version: 4.8
Platform: Android
OS version: 11
Device manufacturer / model: OPPO CPH2035
Cordova version (
cordova -v
): 11.0.0Cordova platform version (
cordova platform ls
): Installed platforms: android 11.0.0 ios 6.2.0 Available platforms: browser ^6.0.0 electron ^3.0.0 windows ^7.0.0Plugin config provided to
#ready
:{ reset: true, debug: false, logLevel: bgGeo.LOG_LEVEL_VERBOSE, desiredAccuracy: bgGeo.DESIRED_ACCURACY_HIGH, distanceFilter: app.config.distanceFilterInMeters, desiredOdometerAccuracy: 250, disableElasticity: true, stationaryRadius: 25, foregroundService: true, enableHeadless: true, notification: { priority: bgGeo.NOTIFICATION_PRIORITY_MIN }, locationAuthorizationRequest: 'Always', backgroundPermissionRationale: { title: "Allow {applicationName} to access to this device's location in the background?", message: "In order to track your activity in the background, please enable {backgroundPermissionOptionLabel} location permission", positiveAction: "Change to {backgroundPermissionOptionLabel}", negativeAction: "Cancel" }, persistMode: bgGeo.PERSIST_MODE_LOCATION, autoSync: true, stopOnTerminate: false, startOnBoot: false, } On getting user login details, new config added:
bgGeo.setConfig({ url: window.app.config.serviceServicePath + 'RecordUserGeoLocation', params: { "EmployeeID": empID, "UserID": userID, "UserName": userName, "Remarks": "Transistorsoft Recording", "AttendanceID": localStorage.getItem("AttendanceID"), } }