iOS long-running background timer with “location” background mode

后端 未结 2 1856
暗喜
暗喜 2020-12-12 00:09

I want to implement long-running background timer which sends user\'s location to server periodically.

To do this, I set location mode for UIBackg

相关标签:
2条回答
  • 2020-12-12 00:53

    if you have set UIBackgroundModes successfully,the App can run a long time in the background while you are moving. But, if you stop moving for over 10 minutes(maybe more), the App will be suspended by the system. Your App will be awake if the location updates,but this awake time will be very short,so you must cal beginBackgroundTaskWithExpirationHandler method to handle location update.

    0 讨论(0)
  • 2020-12-12 00:54

    https://github.com/voyage11/Location

    Use this code.you can set time interval you want to call it. I have tried many codes, but i found this as most accurate and least battery issue.This is also awesome for background location service. :)

    0 讨论(0)
提交回复
热议问题