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

后端 未结 2 1882
暗喜
暗喜 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.

提交回复
热议问题