IOS (Swift 3) How to trigger broadcast receiver when gps is turn on/off?


Hello Friends

I am android(java/kotlin) and IOS(Swift) Developer. So I can easily get broadcast of GPS Enable/Disable in Android. But problem is in IOS platform.

If user Enable or Disable GPS from phone settings. Is any way to get callback to detect enabling/disabling GPS from my app.


you can get location permission is granted or not for application. I think that is the solution. You can check whether user allow location permission or not. You can check in application become active method if user manually enabled or disabled location service for app



If user updates location services permission in settings and then enters the app (that was still loaded in memory), your CLLocationManagerDelegate implementation should receive authorization status update in function:

func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus)

If you want to make action after first authorization positive change, just persist previou state somehow into user defaults or other persisting options


Thanks its worked
– Deepak Ror
9 hours ago