iOS - CoreLocation and geofencing while app is closed

后端 未结 4 460
面向向阳花
面向向阳花 2020-12-04 06:50

I\'ve read many tutorials about geofencing my iOS app (i.e., here), but none mention whether or not iOS allows any app-specific location data to be handled when the app is c

4条回答
  •  时光取名叫无心
    2020-12-04 07:33

    Some forms of location update require the app to be running in the background, some don't. If you want 'constant' location updates then the app needs to be running in the background. If you want only significant changes (and I think it works for region monitoring too, though the docs aren't quite so explicit) then the app will be relaunched if it was terminated:

    If you start this service and your application is subsequently terminated, the system automatically relaunches the application into the background if a new event arrive...

    (from CLLocationManager docs)

提交回复
热议问题