Skip to content

Commit bcbf8d1

Browse files
committed
Merge branch 'release/5.0.2'
2 parents 3d16166 + eb2f856 commit bcbf8d1

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

Sources/SwiftLocation/Extensions/CLLocationManager+Extension.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,15 @@ extension CLAuthorizationStatus: CustomStringConvertible {
146146
return false
147147
}
148148
}
149+
150+
internal var isRejected: Bool {
151+
switch self {
152+
case .denied, .restricted:
153+
return true
154+
default:
155+
return false
156+
}
157+
}
149158

150159
public var description: String {
151160
switch self {

Sources/SwiftLocation/SwiftLocation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ public class LocationManager: LocationManagerDelegate, CustomStringConvertible {
551551
}
552552

553553
private func failWeakAuthorizationRequests() {
554-
guard authorizationStatus.isAuthorized == false else {
554+
guard authorizationStatus.isRejected == true else {
555555
// If we have already the authorization even request with `avoidRequestAuthorization = true`
556556
// may receive notifications of locations.
557557
return

SwiftLocation.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "SwiftLocation"
3-
s.version = "5.0.1"
3+
s.version = "5.0.2"
44
s.summary = "Location Manager Made Easy"
55
s.description = <<-DESC
66
Efficient location tracking for iOS with support for oneshot/continuous/background tracking, reverse geocoding, autocomplete, geofencing, beacon monitoring & broadcasting

SwiftLocationPlayground/SwiftLocationPlayground/View Controllers/Features/Location by GPS/GPSController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ class GPSController: UIViewController, UITableViewDelegate, UITableViewDataSourc
232232
let request = SwiftLocation.gpsLocationWith(serviceOptions)
233233

234234
serviceOptions = GPSLocationOptions()
235+
serviceOptions.avoidRequestAuthorization = true
235236
reloadData()
236237

237238
AppDelegate.attachSubscribersToGPS([request])

0 commit comments

Comments
 (0)