How Can I Continue updating my location even when app is killed or removed from background in ios?

后端 未结 2 713
伪装坚强ぢ
伪装坚强ぢ 2021-01-03 17:31

My app requires to update location continuously, even if app is killed or removed from background. It works fine in foreground and even in background mode.but not working wh

2条回答
  •  时光说笑
    2021-01-03 17:52

    Its possible, but you'll have to jump through a few hoops. The only way to send location updates when killed is by using Region Monitoring (https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/LocationAwarenessPG/RegionMonitoring/RegionMonitoring.html). When setup up, your app would be opened by the OS then you have a few seconds to process information before the app is killed. Its enough time to send location updates to your server/local storage. There is also another API called CLVisit, however, its completely controlled by the operating system and not reliable.

提交回复
热议问题