@@ -51,7 +51,9 @@ public final class AsyncLocationManager {
5151 locationDelegate = LocationDelegate ( delegateProxy: proxyDelegate)
5252 self . locationManager. delegate = locationDelegate
5353 self . locationManager. desiredAccuracy = desiredAccuracy. convertingAccuracy
54+ #if !os(tvOS)
5455 self . locationManager. allowsBackgroundLocationUpdates = allowsBackgroundLocationUpdates
56+ #endif
5557 }
5658
5759
@@ -64,7 +66,7 @@ public final class AsyncLocationManager {
6466
6567 @available ( watchOS 6 . 0 , * )
6668 public func getAuthorizationStatus( ) -> CLAuthorizationStatus {
67- if #available( iOS 14 , watchOS 7 , * ) {
69+ if #available( iOS 14 , tvOS 14 , watchOS 7 , * ) {
6870 return locationManager. authorizationStatus
6971 } else {
7072 return CLLocationManager . authorizationStatus ( )
@@ -116,7 +118,7 @@ public final class AsyncLocationManager {
116118 proxyDelegate. cancel ( for: AccuracyAuthorizationMonitoringPerformer . self)
117119 }
118120
119- @available ( iOS 14 , watchOS 7 , * )
121+ @available ( iOS 14 , tvOS 14 , watchOS 7 , * )
120122 public func getAccuracyAuthorization( ) -> CLAccuracyAuthorization {
121123 locationManager. accuracyAuthorization
122124 }
@@ -125,6 +127,7 @@ public final class AsyncLocationManager {
125127 locationManager. desiredAccuracy = newAccuracy. convertingAccuracy
126128 }
127129
130+ @available ( tvOS, unavailable)
128131 public func updateAllowsBackgroundLocationUpdates( with newAllows: Bool ) {
129132 locationManager. allowsBackgroundLocationUpdates = newAllows
130133 }
@@ -151,8 +154,8 @@ public final class AsyncLocationManager {
151154
152155#if !APPCLIP
153156 @available ( * , deprecated, message: " Use new function requestPermission(with:) " )
154- @available ( watchOS 7 . 0 , * )
155- @available ( iOS 14 , * )
157+ @available ( tvOS , unavailable )
158+ @available ( iOS 14 , tvOS 14 , * )
156159 public func requestAuthorizationAlways( ) async -> CLAuthorizationStatus {
157160 let authorizationPerformer = RequestAuthorizationPerformer ( currentStatus: getAuthorizationStatus ( ) )
158161 return await withTaskCancellationHandler ( operation: {
@@ -171,7 +174,8 @@ public final class AsyncLocationManager {
171174 } else {
172175 authorizationPerformer. linkContinuation ( continuation)
173176 proxyDelegate. addPerformer ( authorizationPerformer)
174- locationManager. requestAlwaysAuthorization ( )
177+ // TODO
178+ // locationManager.requestAlwaysAuthorization()
175179 }
176180#endif
177181 }
@@ -195,11 +199,12 @@ public final class AsyncLocationManager {
195199 }
196200 }
197201
198- @available ( iOS 14 , watchOS 7 , * )
202+ @available ( iOS 14 , tvOS 14 , watchOS 7 , * )
199203 public func requestTemporaryFullAccuracyAuthorization( purposeKey: String ) async throws -> CLAccuracyAuthorization ? {
200204 try await locationPermissionTemporaryFullAccuracy ( purposeKey: purposeKey)
201205 }
202206
207+ @available ( tvOS, unavailable)
203208 public func startUpdatingLocation( ) async -> LocationStream {
204209 let monitoringPerformer = MonitoringUpdateLocationPerformer ( )
205210 return LocationStream { streamContinuation in
@@ -231,6 +236,7 @@ public final class AsyncLocationManager {
231236 }
232237
233238 @available ( watchOS, unavailable)
239+ @available ( tvOS, unavailable)
234240 public func startMonitoring( for region: CLRegion ) async -> RegionMonitoringStream {
235241 let performer = RegionMonitoringPerformer ( region: region)
236242 return RegionMonitoringStream { streamContinuation in
@@ -244,6 +250,7 @@ public final class AsyncLocationManager {
244250 }
245251
246252 @available ( watchOS, unavailable)
253+ @available ( tvOS, unavailable)
247254 public func stopMonitoring( for region: CLRegion ) {
248255 proxyDelegate. cancel ( for: RegionMonitoringPerformer . self) { regionMonitoring in
249256 guard let regionPerformer = regionMonitoring as? RegionMonitoringPerformer else { return false }
@@ -253,6 +260,7 @@ public final class AsyncLocationManager {
253260 }
254261
255262 @available ( watchOS, unavailable)
263+ @available ( tvOS, unavailable)
256264 public func startMonitoringVisit( ) async -> VisitMonitoringStream {
257265 let performer = VisitMonitoringPerformer ( )
258266 return VisitMonitoringStream { stream in
@@ -266,6 +274,7 @@ public final class AsyncLocationManager {
266274 }
267275
268276 @available ( watchOS, unavailable)
277+ @available ( tvOS, unavailable)
269278 public func stopMonitoringVisit( ) {
270279 proxyDelegate. cancel ( for: VisitMonitoringPerformer . self)
271280 locationManager. stopMonitoringVisits ( )
@@ -292,6 +301,7 @@ public final class AsyncLocationManager {
292301#endif
293302
294303 @available ( watchOS, unavailable)
304+ @available ( tvOS, unavailable)
295305 public func startRangingBeacons( satisfying: CLBeaconIdentityConstraint ) async -> BeaconsRangingStream {
296306 let performer = BeaconsRangePerformer ( satisfying: satisfying)
297307 return BeaconsRangingStream { stream in
@@ -305,6 +315,7 @@ public final class AsyncLocationManager {
305315 }
306316
307317 @available ( watchOS, unavailable)
318+ @available ( tvOS, unavailable)
308319 public func stopRangingBeacons( satisfying: CLBeaconIdentityConstraint ) {
309320 proxyDelegate. cancel ( for: BeaconsRangePerformer . self) { beaconsMonitoring in
310321 guard let beaconsPerformer = beaconsMonitoring as? BeaconsRangePerformer else { return false }
@@ -346,12 +357,13 @@ extension AsyncLocationManager {
346357 locationManager. requestAlwaysAuthorization ( )
347358 }
348359#else
349- if #available( iOS 14 , watchOS 7 , * ) , locationManager. authorizationStatus != . notDetermined && locationManager. authorizationStatus != . authorizedWhenInUse {
360+ if #available( iOS 14 , tvOS 14 , watchOS 7 , * ) , locationManager. authorizationStatus != . notDetermined && locationManager. authorizationStatus != . authorizedWhenInUse {
350361 continuation. resume ( with: . success( locationManager. authorizationStatus) )
351362 } else {
352363 authorizationPerformer. linkContinuation ( continuation)
353364 proxyDelegate. addPerformer ( authorizationPerformer)
354- locationManager. requestAlwaysAuthorization ( )
365+ // TODO
366+ // locationManager.requestAlwaysAuthorization()
355367 }
356368#endif
357369 }
@@ -360,7 +372,7 @@ extension AsyncLocationManager {
360372 } )
361373 }
362374
363- @available ( iOS 14 , watchOS 7 , * )
375+ @available ( iOS 14 , tvOS 14 , watchOS 7 , * )
364376 private func locationPermissionTemporaryFullAccuracy( purposeKey: String ) async throws -> CLAccuracyAuthorization ? {
365377 let authorizationPerformer = RequestAccuracyAuthorizationPerformer ( )
366378 return try await withTaskCancellationHandler ( operation: {
0 commit comments