Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // check if turned off location services
- if !TXBLocationManager.sharedInstance.locationServicesActive() && !isLocationModalShown {
- // Check if location services for device are off
- 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")!)
- } else if !TXBLocationManager.sharedInstance.locationAlwaysAuthorizationGranted() && !isLocationModalShown {
- let settingsURL = URL(string: UIApplication.openSettingsURLString)!
- if TXBLocationManager.sharedInstance.locationWheinInUserAuthorizationGranted() {
- //Check if location services are authorized for when in use only.
- 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)
- } else {
- // Check if location not authorized by user, we need always auth
- showLocationSettingsWith(title: NSLocalizedString("servicesDisabledAlertTitleKey", comment: "Disabled GPS"), message: NSLocalizedString("servicesDisabledAlertMessageKey", comment: "Please enable Location/GPS services in your device settings"), url: settingsURL)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement