mirror of
https://github.com/lux-tel/session-ios.git
synced 2026-10-30 20:38:32 +00:00
• Added code to write user metadata to disk • Added code to write config dumps to disk • Added code to write push notification messages to disk • Added code to read push notification messages from disk on launch • Added code to calculate the unread count in the PN extension (based on the last known main app unread count) • Added code to replicate config dumps to the AppGroup for extensions to load • Added async/await read & write functions to Storage • Tweaked the logic when the user taps on a notification to wait until after the PN extension message files have been loaded (with a 3s timeout) • Fixed an issue where notifications were being overwritten in all cases (now using the serverHash as the identifier when available)
13 lines
592 B
Swift
13 lines
592 B
Swift
// Copyright © 2025 Rangeproof Pty Ltd. All rights reserved.
|
|
|
|
import Foundation
|
|
|
|
public extension Task where Success == Never, Failure == Never {
|
|
/// Suspends the current task until the given deadline (compatibility version).
|
|
@available(iOS, introduced: 13.0, obsoleted: 16.0, message: "Use built-in Task.sleep(for:) accepting Swift.Duration on iOS 16+")
|
|
static func sleep(for interval: DispatchTimeInterval) async throws {
|
|
let nanosecondsToSleep: UInt64 = (UInt64(interval.milliseconds) * 1_000_000)
|
|
try await Task.sleep(nanoseconds: nanosecondsToSleep)
|
|
}
|
|
}
|