Constantly tracking user location on iOS

后端 未结 4 491
花落未央
花落未央 2021-02-09 05:09

I need to constantly monitor the position of an user to notify him when he gets near something interesting. Which is the correct way to achieve this?

I have not been abl

4条回答
  •  死守一世寂寞
    2021-02-09 05:55

    As far as I know, significant change location update is the only way to update current location when the app is running in background or not suspended(terminated) by system. when that happens, be sure to check UIApplicationLaunchOptionsLocationKey and initialise CLLocationManager to handle location change notification. If the app is running in foreground, that's simple case.

    By the way, in order to let system keep updating location to your app, you must enable maps feature and background modes(location updates) for the project.

    read Apple location/Map documents for more details.

提交回复
热议问题