diff --git a/Sources/ComposableCoreLocation/Interface.swift b/Sources/ComposableCoreLocation/Interface.swift index 8652870..0afb5af 100644 --- a/Sources/ComposableCoreLocation/Interface.swift +++ b/Sources/ComposableCoreLocation/Interface.swift @@ -294,9 +294,7 @@ public struct LocationManager { public var requestWhenInUseAuthorization: () -> Effect - public var requestTemporaryFullAccuracyAuthorization: - (String) - -> Effect + public var requestTemporaryFullAccuracyAuthorization: (String) -> Effect public var set: (Properties) -> Effect diff --git a/Sources/ComposableCoreLocation/Live.swift b/Sources/ComposableCoreLocation/Live.swift index f786e1a..5fbc8f4 100644 --- a/Sources/ComposableCoreLocation/Live.swift +++ b/Sources/ComposableCoreLocation/Live.swift @@ -103,13 +103,21 @@ extension LocationManager { } }, requestTemporaryFullAccuracyAuthorization: { purposeKey in - .fireAndForget { + .run { subscriber in #if (compiler(>=5.3) && !(os(macOS) || targetEnvironment(macCatalyst))) || compiler(>=5.3.1) if #available(iOS 14.0, tvOS 14.0, watchOS 7.0, macOS 11.0, macCatalyst 14.0, *) { - manager - .requestTemporaryFullAccuracyAuthorization(withPurposeKey: purposeKey) + manager.requestTemporaryFullAccuracyAuthorization( + withPurposeKey: purposeKey + ) { error in + subscriber.send(completion: error.map { .failure(.init($0)) } ?? .finished) + } + } else { + subscriber.send(completion: .finished) } + #else + subscriber.send(completion: .finished) #endif + return AnyCancellable {} } }, set: { properties in