Reputation: 21
I am creating an app that's using a CLLocationManager to track my position and update it to a database with a Google Map. The sole purpose for this app is to stay in the background and continue to update your location as long as you've logged in and set an Available key to true.
The app works fine in the foreground and it updates my location every minute, but when it's in the background it stops after 15 minutes as the app suspends (I suspect). I've implemented the startMonitoringSignificantLocationChanges() method, but if I stay in one place for too long without opening the app manually after 15 minutes, the updates stops and my map only plots your location for so long without you updating and resetting the lastLogged timestamp.
Is there any way I can force-activate the app to a background state without actually opening the app itself? As the plan is for many people to start using this app, opening the app every 15 minutes is going to be a massive bother and I would love for some way to do this automatically.
Thanks for any help!
Upvotes: 2
Views: 933
Reputation: 9246
PushKit allow you to send messages directly to the people who have installed your app, even when the app is closed on a device or in background. Its a new framework in iOS 8, is the new push notification mechanism which silently launch your app into the background without the need of user interact with the app.
Here is link in Apple:- https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/PushKit_Framework/
Upvotes: 0