Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 1.59 KB | None | 0 0
  1. // check if turned off location services
  2. if !TXBLocationManager.sharedInstance.locationServicesActive() && !isLocationModalShown {
  3.             // Check if location services for device are off
  4.             showLocationSettingsWith(title: NSLocalizedString("servicesDisabledAlertTitleKey", comment: "Disabled GPS"), message: NSLocalizedString("servicesDisabledAlertMessageKey", comment: "Please enable Location/GPS services in your device settings"), url: URL(string: "App-Prefs:root=Privacy&path=LOCATION")!)
  5.         }  else if !TXBLocationManager.sharedInstance.locationAlwaysAuthorizationGranted() && !isLocationModalShown {
  6.             let settingsURL = URL(string: UIApplication.openSettingsURLString)!
  7.             if TXBLocationManager.sharedInstance.locationWheinInUserAuthorizationGranted() {
  8.                 //Check if location services are authorized for when in use only.
  9.                 showLocationSettingsWith(title: NSLocalizedString("alwaysPermissionRequiredTitleKey", comment: "Always On Location Access"), message: NSLocalizedString("alwaysPermissionRequiredDescriptionKey", comment: "Please switch the Location Access to "Always On" in your device settings in order to use Beat"), url: settingsURL)
  10.             } else {
  11.                 // Check if location not authorized by user, we need always auth
  12.                 showLocationSettingsWith(title: NSLocalizedString("servicesDisabledAlertTitleKey", comment: "Disabled GPS"), message: NSLocalizedString("servicesDisabledAlertMessageKey", comment: "Please enable Location/GPS services in your device settings"), url: settingsURL)
  13.             }
  14.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement