Skip to content

Commit 0c11d4d

Browse files
authored
feat: set supported platforms as iOS 16, macOS 13, watchOS 9, and tvOS 16 (#832)
1 parent 57a55bc commit 0c11d4d

File tree

9 files changed

+18
-53
lines changed

9 files changed

+18
-53
lines changed

Package.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import PackageDescription
77
let package = Package(
88
name: "Supabase",
99
platforms: [
10-
.iOS(.v13),
11-
.macCatalyst(.v13),
12-
.macOS(.v10_15),
13-
.watchOS(.v6),
14-
.tvOS(.v13),
10+
.iOS(.v16),
11+
.macCatalyst(.v16),
12+
.macOS(.v13),
13+
.watchOS(.v9),
14+
.tvOS(.v16),
1515
],
1616
products: [
1717
.library(name: "Auth", targets: ["Auth"]),

[email protected]

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import PackageDescription
77
let package = Package(
88
name: "Supabase",
99
platforms: [
10-
.iOS(.v13),
11-
.macCatalyst(.v13),
12-
.macOS(.v10_15),
13-
.watchOS(.v6),
14-
.tvOS(.v13),
10+
.iOS(.v16),
11+
.macCatalyst(.v16),
12+
.macOS(.v13),
13+
.watchOS(.v9),
14+
.tvOS(.v16),
1515
],
1616
products: [
1717
.library(name: "Auth", targets: ["Auth"]),

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Supabase SDK for Swift. Mirrors the design of [supabase-js](https://github.com/s
1010
## Usage
1111

1212
### Requirements
13-
- iOS 13.0+ / macOS 10.15+ / tvOS 13+ / watchOS 6+ / visionOS 1+
13+
- iOS 16.0+ / macOS 13+ / tvOS 16+ / watchOS 9+ / visionOS 1+
1414
- Xcode 15.3+
1515
- Swift 5.10+
1616

Sources/Auth/AuthClient.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,6 @@ public actor AuthClient {
702702
/// - Note: This method support the PKCE flow.
703703
/// - Warning: Do not call `start()` on the `ASWebAuthenticationSession` object inside the
704704
/// `configure` closure, as the method implementation calls it already.
705-
@available(watchOS 6.2, tvOS 16.0, *)
706705
@discardableResult
707706
public func signInWithOAuth(
708707
provider: Provider,

Sources/Helpers/Logger/OSLogSupabaseLogger.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import Foundation
2323
/// options: .init(global: .init(logger: supabaseLogger))
2424
/// )
2525
/// ```
26-
@available(macOS 11.0, iOS 14.0, tvOS 14.0, watchOS 7.0, *)
2726
public struct OSLogSupabaseLogger: SupabaseLogger {
2827
private let logger: Logger
2928

Sources/Helpers/Task+withTimeout.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ package func withTimeout<R: Sendable>(
2626
group.addTask {
2727
let interval = deadline.timeIntervalSinceNow
2828
if interval > 0 {
29-
try await _clock.sleep(for: interval)
29+
try await _clock.sleep(for: .seconds(interval))
3030
}
3131
try Task.checkCancellation()
3232
throw TimeoutError()

Sources/Helpers/_Clock.swift

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,10 @@ import Clocks
99
import ConcurrencyExtras
1010
import Foundation
1111

12-
package protocol _Clock: Sendable {
13-
func sleep(for duration: TimeInterval) async throws
14-
}
15-
16-
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
17-
extension ContinuousClock: _Clock {
18-
package func sleep(for duration: TimeInterval) async throws {
19-
try await sleep(for: .seconds(duration))
20-
}
21-
}
22-
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
23-
extension TestClock<Duration>: _Clock {
24-
package func sleep(for duration: TimeInterval) async throws {
25-
try await sleep(for: .seconds(duration))
26-
}
27-
}
28-
29-
/// `_Clock` used on platforms where ``Clock`` protocol isn't available.
30-
struct FallbackClock: _Clock {
31-
func sleep(for duration: TimeInterval) async throws {
32-
try await Task.sleep(nanoseconds: NSEC_PER_SEC * UInt64(duration))
33-
}
34-
}
35-
36-
// Resolves clock instance based on platform availability.
37-
let _resolveClock: @Sendable () -> any _Clock = {
38-
if #available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) {
39-
ContinuousClock()
40-
} else {
41-
FallbackClock()
42-
}
43-
}
44-
45-
private let __clock = LockIsolated(_resolveClock())
12+
private let __clock: LockIsolated<any Clock<Duration>> = LockIsolated(ContinuousClock())
4613

4714
#if DEBUG
48-
package var _clock: any _Clock {
15+
package var _clock: any Clock<Duration> {
4916
get {
5017
__clock.value
5118
}
@@ -54,7 +21,7 @@ private let __clock = LockIsolated(_resolveClock())
5421
}
5522
}
5623
#else
57-
package var _clock: any _Clock {
24+
package var _clock: any Clock<Duration> {
5825
__clock.value
5926
}
6027
#endif

Sources/Realtime/RealtimeChannelV2.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public final class RealtimeChannelV2: Sendable, RealtimeChannelProtocol {
137137
)
138138

139139
do {
140-
try await _clock.sleep(for: delay)
140+
try await _clock.sleep(for: .seconds(delay))
141141
} catch {
142142
// If sleep is cancelled, break out of retry loop
143143
logger?.debug("Subscription retry cancelled for channel '\(topic)'")

Sources/Realtime/RealtimeClientV2.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public final class RealtimeClientV2: Sendable, RealtimeClientProtocol {
187187
if status == .disconnected {
188188
let connectionTask = Task {
189189
if reconnect {
190-
try? await _clock.sleep(for: options.reconnectDelay)
190+
try? await _clock.sleep(for: .seconds(options.reconnectDelay))
191191

192192
if Task.isCancelled {
193193
options.logger?.debug("Reconnect cancelled, returning")
@@ -398,7 +398,7 @@ public final class RealtimeClientV2: Sendable, RealtimeClientProtocol {
398398
private func startHeartbeating() {
399399
let heartbeatTask = Task { [weak self, options] in
400400
while !Task.isCancelled {
401-
try? await _clock.sleep(for: options.heartbeatInterval)
401+
try? await _clock.sleep(for: .seconds(options.heartbeatInterval))
402402
if Task.isCancelled {
403403
break
404404
}

0 commit comments

Comments
 (0)