mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-18 03:27:08 +00:00
Hub: - add encrypted Live Activity token registry, registration API, and update/end pushes over direct APNs - enable only for HAPI_IOS_PUSH=apns; relay reports remote:false - keep content-state encrypted with the per-install push key and a domain-separated AAD iOS: - add ActivityKit coordinator, HapiWidgets extension, lock-screen and Dynamic Island UI, encrypted content-state, deep links, and settings toggle - cap concurrent activities and reconcile across hub switches Docs/tests: - native contract, privacy, READMEs, localization catalogs - cross-language cipher fixture and hub/iOS unit tests via [HAPI](https://hapi.run) Co-Authored-By: HAPI <noreply@hapi.run> Co-Authored-By: Claude Code <noreply@anthropic.com>
29 lines
950 B
Swift
29 lines
950 B
Swift
import Foundation
|
|
|
|
#if os(iOS) && !targetEnvironment(macCatalyst)
|
|
import ActivityKit
|
|
#endif
|
|
|
|
/// Static attributes for one session's Live Activity.
|
|
///
|
|
/// Declared unconditionally so macOS/Linux package tests can construct it;
|
|
/// the `ActivityAttributes` conformance is only compiled for iOS (not
|
|
/// Catalyst), where ActivityKit is actually available. `hubUrl` stays local:
|
|
/// it is not part of any APNs payload, and lets a recovered activity end
|
|
/// itself after a hub switch and build the right deep link.
|
|
public struct SessionActivityAttributes: Codable, Hashable, Sendable {
|
|
public var sessionId: String
|
|
public var hubUrl: String
|
|
|
|
public init(sessionId: String, hubUrl: String) {
|
|
self.sessionId = sessionId
|
|
self.hubUrl = hubUrl
|
|
}
|
|
}
|
|
|
|
#if os(iOS) && !targetEnvironment(macCatalyst)
|
|
extension SessionActivityAttributes: ActivityAttributes {
|
|
public typealias ContentState = EncryptedLiveActivityState
|
|
}
|
|
#endif
|