Closed erluxman closed 3 years ago
See Wiki Debugging to learn how to fetch an analyze the logs from the plugin with emailLog
.
Do I upload those logs here or send them to your email?
Do I have to provide my actual timeline along with these longs in another doc as well or log will be enough? By my actual timelin, I mean my manual records of the modes that I took and the time of those events?
My Realtimeline.
I had changed my time from Nepal time to Quebec time for this test.
3:35 Closed all apps (iphone app,android app and sample app)
3:48 Opened all three apps
3:54 Closed all apps agan. ( then drove for some time)
Took rest until 5:42 AM and started driving on motorbike
5:49 Rebooted device and unlocked it right after
5:56 Unlocked both devices again (as I didn’t hear debug sounds)- started hearing debug sound again.
6:06 Stopped.
{
activityRecognitionInterval = 10000;
activityType = 1;
authorization = {
};
autoSync = 1;
autoSyncThreshold = 0;
batchSync = 0;
debug = 0;
desiredAccuracy = "-1";
desiredOdometerAccuracy = 100;
didLaunchInBackground = 0;
didRequestUpgradeLocationAuthorization = 1;
disableAutoSyncOnCellular = 0;
disableElasticity = 1;
disableLocationAuthorizationAlert = 0;
disableMotionActivityUpdates = 0;
disableStopDetection = 0;
distanceFilter = 2;
elasticityMultiplier = 1;
enableTimestampMeta = 0;
enabled = 0;
extras = {
};
geofenceInitialTriggerEntry = 1;
geofenceProximityRadius = 2000;
geofenceTemplate = "";
headers = {
};
heartbeatInterval = 60;
httpRootProperty = location;
httpTimeout = 60000;
iOSHasWarnedLocationServicesOff = 1;
isFirstBoot = 0;
isMoving = 0;
lastLocationAuthorizationStatus = 3;
locationAuthorizationAlert = {
cancelButton = Cancel;
instructions = "To use background location, you must enable '{locationAuthorizationRequest}' in the Location Services settings";
settingsButton = Settings;
titleWhenNotEnabled = "Background location is not enabled";
titleWhenOff = "Location services are off";
};
locationAuthorizationRequest = Always;
locationTemplate = "";
locationTimeout = 60;
locationsOrderDirection = ASC;
logLevel = 5;
logMaxDays = 3;
maxBatchSize = "-1";
maxDaysToPersist = 1;
maxRecordsToPersist = 1000;
method = POST;
minimumActivityRecognitionConfidence = 75;
odometer = "11307.98223071513";
params = {
};
pausesLocationUpdatesAutomatically = 1;
persistMode = 2;
preventSuspend = 0;
schedule = (
);
schedulerEnabled = 0;
showsBackgroundLocationIndicator = 0;
startOnBoot = 1;
stationaryRadius = 25;
stopAfterElapsedMinutes = "-1";
stopDetectionDelay = 0;
stopOnStationary = 0;
stopOnTerminate = 0;
stopTimeout = 5;
trackingMode = 1;
url = "";
useSignificantChangesOnly = 0;
}
Logs from our app is as follows :
╔═════════════════════════════════════════════
║ TSLocationManager version: 3.1.22 (378)
╠═════════════════════════════════════════════
╟─ Xiaomi POCO X2 @ 11 (flutter)
{
"activityRecognitionInterval": 10000,
"allowIdenticalLocations": false,
"authorization": {},
"autoSync": true,
"autoSyncThreshold": 0,
"backgroundPermissionRationale": {
"title": "Allow Greenplay to access this device's location even when the app is closed or not in use.",
"message": "This app collects location data to enable recording your trips to work and calculate distance-travelled.",
"positiveAction": "Change to Always allow",
"negativeAction": "Cancel"
},
"batchSync": false,
"configUrl": "",
"debug": false,
"deferTime": 0,
"desiredAccuracy": -1,
"desiredOdometerAccuracy": 100,
"disableAutoSyncOnCellular": false,
"disableElasticity": true,
"disableLocationAuthorizationAlert": false,
"disableMotionActivityUpdates": false,
"disableStopDetection": false,
"distanceFilter": 2,
"elasticityMultiplier": 1,
"enableHeadless": true,
"enableTimestampMeta": false,
"extras": {},
"fastestLocationUpdateInterval": 10000,
"foregroundService": true,
"geofenceInitialTriggerEntry": true,
"geofenceModeHighAccuracy": false,
"geofenceProximityRadius": 1000,
"geofenceTemplate": "",
"headers": {},
"headlessJobService": "com.transistorsoft.flutter.backgroundgeolocation.HeadlessTask",
"heartbeatInterval": 60,
"httpRootProperty": "location",
"httpTimeout": 60000,
"isMoving": true,
"locationAuthorizationRequest": "Always",
"locationTemplate": "",
"locationTimeout": 60,
"locationUpdateInterval": 1000,
"locationsOrderDirection": "ASC",
"logLevel": 5,
"logMaxDays": 3,
"maxBatchSize": -1,
"maxDaysToPersist": 1,
"maxRecordsToPersist": 1000,
"method": "POST",
"minimumActivityRecognitionConfidence": 75,
"motionTriggerDelay": 0,
"notification": {
"layout": "",
"title": "",
"text": "Fetching location",
"color": "",
"channelName": "TSLocationManager",
"smallIcon": "",
"largeIcon": "",
"priority": 0,
"sticky": false,
"strings": {},
"actions": []
},
"params": {},
"persist": true,
"persistMode": 2,
"schedule": [],
"scheduleUseAlarmManager": false,
"speedJumpFilter": 300,
"startOnBoot": true,
"stationaryRadius": 25,
"stopAfterElapsedMinutes": 0,
"stopOnStationary": false,
"stopOnTerminate": false,
"stopTimeout": 5,
"triggerActivities": "in_vehicle, on_bicycle, on_foot, running, walking",
"url": "",
"useSignificantChangesOnly": false,
"enabled": true,
"schedulerEnabled": false,
"trackingMode": 1,
"odometer": 11576.0078125,
"isFirstBoot": false,
"didLaunchInBackground": false
}
╔═════════════════════════════════════════════
║ DEVICE SENSORS
╠═════════════════════════════════════════════
╟─ ✅ ACCELEROMETER: {Sensor name="icm4x6xx Accelerometer Non-wakeup", vendor="TDK-Invensense", version=291, type=1, maxRange=156.9064, resolution=0.0047884034, power=0.24, minDelay=2000}
╟─ ✅ GYROSCOPE: {Sensor name="icm4x6xx Gyroscope Non-wakeup", vendor="TDK-Invensense", version=291, type=4, maxRange=34.905556, resolution=0.001065233, power=0.57, minDelay=2000}
╟─ ✅ MAGNETOMETER: {Sensor name="ak0991x Magnetometer Non-wakeup", vendor="akm", version=20034, type=2, maxRange=4911.994, resolution=0.15, power=1.1, minDelay=10000}
╟─ ✅ SIGNIFICANT_MOTION: {Sensor name="sns_smd Wakeup", vendor="qualcomm", version=1, type=17, maxRange=1.0, resolution=1.0, power=0.025, minDelay=-1}
╚═════════════════════════════════════════════
Do you have a question?
App gets location updates from this plugin when app is in foreground, when minimized, when swipe closed from recent menu and when device is rebooted.
What is the possibility of such occurance.. I will also uplo
Data uploads from Android.
https://user-images.githubusercontent.com/6260014/114874279-e6e4ec00-9e1b-11eb-9b8f-bbed34039c8e.mov
Data uploaded from iPhone
https://user-images.githubusercontent.com/6260014/114874095-b3a25d00-9e1b-11eb-9ef8-7c5b730a377c.mov
As you can see in the above videos, considering this timeline :
3:35 Closed all apps (iphone app,android app and sample app)
3:48 Opened all three apps
3:54 Closed all apps agan. ( then drove for some time)
Took rest until 5:42 AM and started driving on motorbike
5:49 Rebooted device and unlocked it right after
5:56 Unlocked both devices again (as I didn’t hear debug sounds)- started hearing debug sound again.
6:06 Stopped.
Logs are uploaded to firestore only when app is in foreground or background but when app is closed or rebooted, it doesn't upload .. But at the same time the sample app from playstore is uploading data properly to http://tracker.transistorsoft.com/greenplay?device=33387&end=2021-4-15&start=2021-4-15
While looking into the logs , they are there even when app is closed from recent or rebooted. So I suspect It has something to do with location_uploader.dart
what kind of code makes it possible to not be able to upload to firestore?
Is it compulsory for such logic to be in main.dart
like the headless callback?
Is it compulsory for such logic to be in main.dart like the headless callback?
Headless == terminated. If your Android app is terminated, then yes.
Headless == terminated. If your Android app is terminated, then yes.
In that case any guess why is it not uploading in iOS even if the whole application is started in background?
iOS has no such concept of "Headless". Headless is an Android-only mechanism.
When an iOS app is terminated, tracking resumes only after the device moves at least 200 meters. See API docs Config.stopOnTerminate
for more information.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.
Closing this issue after a prolonged period of inactivity. Fell free to reopen this issue, if this still affecting you.
Let's start with our requirement.
To put it simply, we recive onLocationUpdate from phone and group the data of those snapshots to detech user's tips and reward them for using sustainable transport modes like bike, walk, train etc.
As soon as we get onLocation update we push it to our firebase backend which has a cache enabled so that even when device is offline, it records and syncs later when internet is availiable.
How it is supposed to work?
App gets location updates from this plugin when app is in foreground, when minimized, when swipe closed from recent menu and when device is rebooted.
How it behaves?
App works fine when its in foreground and its minimized but, once the app is swiped off from recent, killed by the OS or device reboots, we can't recive location updates automatically. But when app is in debug mode, I can hear the sounds I think it's heartbeat but it isn't recorded in firestore.
Then I thought there might be issue with adding object to firestore so I tried to add the onLocation update events inshared preferences but even that doesn't provide any evidence that onLocation update was called.
In Android I can hear the sound most of the time, but in iOS it's kind of random, sometimes I hear the sound when I am driving sometimes I can't.
My setup
Flutter doctor
Android Manifest
Android App Gradle
Android Project Gradle
iOS Plist
iOS Podfile
Dart main.dart
Dart location_tracker.dart
Dart location_uploader.dart
So When app is in foregorund or minimized the
SessionUploader.onLocationUpdate()
is called and the data is saved in database and preferences but when app is removed from recent or phone reboot, I only hear the debug sound but no evidence of location update.Why is this happening? Am I making any mistake or the plugin is limited?