Closed aaronharper123 closed 5 years ago
after I get all stored location when the app is in background or foreground, I pushed to the server and after I delete the location, but when the app is closed then no any data are retrieved.
The plugin automatically deletes its locations when your server returns HTTP 200
.
The plugin absolutely 100% persists every single location it records, regardless of background / foreground / after terminate.
You realize that your Javascript code you're using to push locations to your server won't run on Android when the app is terminated?
This is why the plugin has its own HTTP service.
But i tested sir , i am not using any http param in config so how it returns 200 and how it can delete ?
I test the plugin every day for the past three+ years. I have thousands of customers. You're doing something wrong. What do the logs say?
i create log for stored location and it goes null
Stop banging your head against the wall and go play with my Sample App until you're more familiar with the plugin.
i am sure about code and you can also see in above
if am . i doing anything wrong then you can see above
i am sure about code and you can also see in above
Sure like this
i tested again but same problem. this.bgGeo.getLocations() method gives mu empty array. If i am doing any wrong then please tell me
XCode logs please.
╔═══════════════════════════════════════════════════════════ ║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 0 | df: -1.0m | age: 0.1s ╚═══════════════════════════════════════════════════════════ ✅-[TSLocationManager locationManager:didUpdateLocations:] Acquired motionchange position: <+37.42467819,-122.22918858> +/- 5.00m (speed 35.86 mps / course 311.13) @ 6/8/18, 8:11:06 PM India Standard Time ℹ️-[TSConfig persist] 🔵-[TSConfig incrementOdometer:] 174.9 🔵-[TSLocationManager startMonitoringStationaryRegion:radius:] Radius: 25 🔴-[TSLocationManager stopUpdatingLocation] 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 5.0 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: 1D87D562-82D3-4796-9715-C28EE424B3B8 2018-06-08 20:11:06.829981+0530 Galio[35114:378727] - location: [object Object] 2018-06-08 20:11:06.830310+0530 Galio[35114:378727] - motionchange: false [object Object] 2018-06-08 20:11:06.830498+0530 Galio[35114:378727] - location: [object Object] 2018-06-08 20:11:06.846485+0530 Galio[35114:378727] stored locations: [object Object] 2018-06-08 20:11:09.847298+0530 Galio[35114:378727] Background Location Data: [{"Lat":37.42467819,"Long":-122.22918858,"Date":"2018-06-08T20:11:06"}] 2018-06-08 20:11:09.875374+0530 Galio[35114:378727] {"_body":"","status":200,"ok":true,"statusText":"OK","headers":{"cache-control":["no-cache"],"content-length":["0"],"date":["Fri"," 08 Jun 2018 14:41:09 GMT"],"expires":["-1"],"pragma":["no-cache"],"server":["Microsoft-IIS/10.0"],"x-aspnet-version":["4.0.30319"],"x-powered-by":["ASP.NET"]},"type":2,"url":"http://property.zoomi.in:86/api/User/UserTracking"} ✅-[LocationDAO clear]_block_invoke Destroyed all locations 2018-06-08 20:11:09.879855+0530 Galio[35114:378727] - cleared database 🔵-[TSLocationManager onResume:] enabled? 1 ℹ️-[LocationDAO purge:] 3 2018-06-08 20:11:10.253608+0530 Galio[35114:378727] BackgroundMode: On simulator apps never pause in background! ℹ️-[TSDBLogger db_save] Log committed 🔵-[TSLocationManager locationManager:didExitRegion:] Exit stationary region 🔵-[TSLocationManager setPace:] 1 ℹ️-[TSConfig persist] 🎾-[SOMotionDetector startShakeDetection:] sample-rate: 0.2 | M7 DISABLED 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON ℹ️+[LocationAuthorization run:] status: 3
📍<+37.42625701,-122.23121884> +/- 5.00m (speed 35.56 mps / course 316.05) @ 6/8/18, 8:11:11 PM India Standard Time
╔═══════════════════════════════════════════════════════════ ║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 1 | df: -1.0m | age: 0.0s ╚═══════════════════════════════════════════════════════════ ✅-[TSLocationManager locationManager:didUpdateLocations:] Acquired motionchange position: <+37.42625701,-122.23121884> +/- 5.00m (speed 35.56 mps / course 316.05) @ 6/8/18, 8:11:11 PM India Standard Time 🎾-[TSLocationManager startUpdatingLocation] Location-services: ON 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 5.0 ℹ️-[TSConfig persist] 🔵-[TSConfig incrementOdometer:] 425.9 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: 1337A8BA-EBA3-4242-9683-3953BD9B3165 ℹ️+[LocationAuthorization run:] status: 3 2018-06-08 20:11:11.671476+0530 Galio[35114:378727] - location: [object Object] 2018-06-08 20:11:11.671690+0530 Galio[35114:378727] - motionchange: true [object Object] 2018-06-08 20:11:11.672432+0530 Galio[35114:378727] - location: [object Object] 2018-06-08 20:11:11.708579+0530 Galio[35114:378727] stored locations: [object Object]
📍<+37.42648156,-122.23149125> +/- 5.00m (speed 35.28 mps / course 315.70) @ 6/8/18, 8:11:12 PM India Standard Time
╔═══════════════════════════════════════════════════════════ ║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 1 | df: 0.0m | age: 0.0s ╚═══════════════════════════════════════════════════════════ 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 5.0 ℹ️-[TSConfig persist] 🔵-[TSConfig incrementOdometer:] 460.6 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: BB856178-C2B9-41BC-81E2-CDBB8546CB1A 2018-06-08 20:11:12.612010+0530 Galio[35114:378727] - location: [object Object] 🔵-[TSLocationManager onSuspend:] enabled? 1) ℹ️-[TSDBLogger db_save] Log committed 2018-06-08 20:11:13.429357+0530 Galio[35114:378727] [Snapshotting] Snapshotting a view (0x7ffc230d3400, UIKeyboardImpl) that has not been rendered at least once requires afterScreenUpdates:YES.
📍<+37.42670804,-122.23176442> +/- 5.00m (speed 35.09 mps / course 315.70) @ 6/8/18, 8:11:13 PM India Standard Time
╔═══════════════════════════════════════════════════════════ ║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 1 | df: 0.0m | age: 0.0s ╚═══════════════════════════════════════════════════════════ 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 5.0 ℹ️-[TSConfig persist] 🔵-[TSConfig incrementOdometer:] 495.4 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: 6FFA2EC8-5C88-4B3A-9BC2-22CC4E982429 2018-06-08 20:11:13.598000+0530 Galio[35114:378727] - location: [object Object]
📍<+37.42693422,-122.23204530> +/- 5.00m (speed 35.02 mps / course 315.70) @ 6/8/18, 8:11:14 PM India Standard Time
╔═══════════════════════════════════════════════════════════ ║ -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 1 | df: 0.0m | age: 0.0s ╚═══════════════════════════════════════════════════════════ 🔵-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 5.0 ℹ️-[TSConfig persist] 🔵-[TSConfig incrementOdometer:] 530.8 ✅-[TSLocationManager persistLocation:]_block_invoke INSERT: 2DAB8DE6-6DD9-42A4-ACDC-F0DB642E4573 2018-06-08 20:11:14.601170+0530 Galio[35114:378727] - location: [object Object] ℹ️-[TSDBLogger db_save] Log committed 🔵-[TSLocationManager onAppTerminate] stopOnTerminate? 0 🔴-[SOMotionDetector stopShakeDetection] OFF 🔵-[TSLocationManager startMonitoringStationaryRegion:radius:] Radius: 28 🔴-[TSLocationManager stopUpdatingLocation] 2018-06-08 20:11:14.693788+0530 Galio[35114:378727] [TSBackgroundFetch onAppTerminate] 2018-06-08 20:11:14.694606+0530 Galio[35114:378727] [TSBackgroundFetch stop]
after i terminated the app in simulator , log goes to ended in xcode
at server side , if we can not put extra param then which object will push to server .
is this whole location object ?
If whole object is pushed then i will manage at server side
is battery.level
gives current battery status ?
What do you think it would mean if I said to you in english "your battery level is 50%"?
i means it gives me in number ?
i means it gives me in number ?
What do you think Float
means?
hello sir sorry for that , i want to ask one, i want to post json object like:
{ "LocationData": { "Lat": "23.00002", "Long": "72.145452", "Date": "2018-04-30T12:53", "BatteryPerc": 44, "UserId": 4, } }
i am doing like this..
url: 'http://property.zoomi.in:86/api/User/UserTracking',
httpRootProperty: 'LocationData',
locationTemplate: '{"Lat":<%= latitude %>,"Long":<%= longitude %>, "Date":<%= timestamp %>, "BatteryPerc":<%= battery.level %>}',
extras: {
"UserId": 4
}`
Is this OK or Not ?
timestamp
is a String
. What do you think would happen if you had the JSON
{
"Date": 2018-06-08T15:45:07.616Z
}
The plugin makes NO ASSUMPTIONS about quoting strings. You must quote your own strings.
..., "Date": "<%= timestamp %>", ...
Okkkk sir, thank you i will implement tomorrow and after that l will update you. till tomorrow , please don't close this issue
Issues are for specific issues. They're not generalized support threads.
The plugin does not store location after the app is terminated. I am not using URL or params in the config object. Instead of this i am using
this.bgGeo.getLocations()
method to retrieve location but this method is not given location when the app is terminated but work fine in background and foreground.Your Environment
cordova -v
): 8.0.0cordova platform ls
): 4.5.4Expected Behavior
My code:
this.platform.ready().then(() => { this.bgGeo = (<any>window).BackgroundGeolocation; const subscription = this.batteryStatus.onChange().subscribe(status => { console.log(status.level, status.isPlugged); this.batteryLevel = status.level; }); this.onDeviceReady(); });
`onDeviceReady() {
}`
` onLocation(location, taskId) { console.log('- location: ', location); let toast = this.toastCtrl.create({ message: 'onLocation call', duration: 2000, position: 'bottom'}); toast.present(); if(location.sample === true) {
}`
Actual Behavior
Steps to Reproduce
1. 2. 3. 4.
Context
Debug logs