Reputation: 99
I Created an app that tracks user location in foreground as well as background. App works fine until I request the location while there's no movement. I used silent notification to get the location, but it won't work in case the app is terminated.
There's an app on the store called Family Map
. This works perfectly and every time I open the app, it gets the other device's location as Now
. I killed the app , I turned off notifications from settings and still I get location every time. I know that it's not getting Significant location change
because there's no movement. I'm not sure if it's NStimer
or something else, but battery consumption is very low and if I turn off the internet on that device, it won't get the location
Does anyone have an idea about how to get the location whenever a user requests for it ?
Upvotes: 0
Views: 552
Reputation: 15151
Turning off notifications turn off displayed notifications, not silent ones, so it's possible to send a notification to wake-up the device and read the location.
BUT, if you kill the app then there's nothing you can do, a dead app is not executed even if a notification is sent to it, so there's no way that app does what you say.
Also, if the device is not moving, why do you need to update it's location? Just use the previous one...
P.D.: the app you tell is an AT&T app, I'm nearly 100% sure they're using the cell registration info to triangulate the position when the app is closed, so you're out of luck if you want to do the same unless you're on a cell phone provider...
Upvotes: 1