mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 23:24:32 +00:00
Something in the way
This commit is contained in:
parent
018050081d
commit
9bd445986d
19 changed files with 2395 additions and 1 deletions
|
|
@ -0,0 +1,53 @@
|
|||
import Foundation
|
||||
import Defaults
|
||||
import AtollExtensionKit
|
||||
import SwiftUI
|
||||
|
||||
struct ExtensionLiveActivityPayload: Identifiable, Hashable {
|
||||
let bundleIdentifier: String
|
||||
let descriptor: AtollLiveActivityDescriptor
|
||||
let receivedAt: Date
|
||||
|
||||
var id: String { descriptor.id }
|
||||
|
||||
var priority: AtollLiveActivityPriority { descriptor.priority }
|
||||
}
|
||||
|
||||
struct ExtensionLockScreenWidgetPayload: Identifiable, Hashable {
|
||||
let bundleIdentifier: String
|
||||
let descriptor: AtollLockScreenWidgetDescriptor
|
||||
let receivedAt: Date
|
||||
|
||||
var id: String { descriptor.id }
|
||||
|
||||
var priority: AtollLiveActivityPriority { descriptor.priority }
|
||||
}
|
||||
|
||||
enum ExtensionValidationError: LocalizedError, Equatable {
|
||||
case featureDisabled
|
||||
case unauthorized
|
||||
case invalidDescriptor(String)
|
||||
case rateLimited
|
||||
case exceedsCapacity
|
||||
case duplicateIdentifier
|
||||
case unsupportedContent
|
||||
|
||||
var errorDescription: String? {
|
||||
switch self {
|
||||
case .featureDisabled:
|
||||
return "Extensions feature is currently disabled in Atoll."
|
||||
case .unauthorized:
|
||||
return "Your app is not authorized to post this content."
|
||||
case .invalidDescriptor(let reason):
|
||||
return "Descriptor validation failed: \(reason)."
|
||||
case .rateLimited:
|
||||
return "Too many requests in a short period. Please slow down."
|
||||
case .exceedsCapacity:
|
||||
return "Atoll reached its limit for simultaneous extension content."
|
||||
case .duplicateIdentifier:
|
||||
return "An item with the same identifier already exists."
|
||||
case .unsupportedContent:
|
||||
return "Descriptor includes unsupported content for this surface."
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue