I want to implement a long-running background timer that sends the location periodically to the user's location.
To do this, I have set But for about 26 minutes the app goes back to the background, it stops sending the server to the location. But the app has not crashed, so after I bring the app to the foreground, it can resume its timer. 26 minutes is with experiments, with iOS 6.1, iPhone 5. Here are some questions, I do not understand why this 26mins is not suspended after 10mins, which is the time limit for background work Before 16mins, I have already tried to call If there is someone who has a clue for this problem, then it will be greatly appreciated. Use this code. You can set the time interval you want to call. I have tried to do many codes, but I found this the most accurate and least battery issue It's also great for background location service :) location mode for
UIBackgroundModes , and call
startBackgroundTaskWithExpirationHandler when the application is in the background And for
CLLocationManager , I use the
startupdatingLocation method (I do not want to use significant changes, because I need a high precision location).
backgroundTimeRemaining methods get double maximum value return. But after 16mins, it decreases from
600 , so it is suspended after 10mins, background work is suspended.
No comments:
Post a Comment