Sending Latitude and Longitude to Server when app is in background

前端 未结 3 1166
难免孤独
难免孤独 2020-12-05 16:59

I have gone through so many links, even after that I haven\'t found a proper solution for getting latitude and longitude.

Periodic iOS background location updates

3条回答
  •  时光说笑
    2020-12-05 17:32

    You need to refer this apple documentation handling location events in the background

    You need to enable location updates in background modes in capabilities of your Xcode project.

    The Standard location service wont work in background mode so you have to use either Significant-change location service or Visits service .

    Use this code to

    locationManager.delegate = self
    locationManager.startMonitoringSignificantLocationChanges()
    

    enable Significant-change location service.

提交回复
热议问题