Live Activities fix
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// swift-tools-version: 5.9
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "MobileMAShared",
|
||||
platforms: [.iOS(.v18)],
|
||||
products: [
|
||||
.library(name: "MobileMAShared", targets: ["MobileMAShared"])
|
||||
],
|
||||
targets: [
|
||||
.target(
|
||||
name: "MobileMAShared",
|
||||
path: "Sources/MobileMAShared"
|
||||
)
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1,22 @@
|
||||
import ActivityKit
|
||||
import Foundation
|
||||
|
||||
public struct MusicActivityAttributes: ActivityAttributes {
|
||||
public struct ContentState: Codable, Hashable, Sendable {
|
||||
public var trackTitle: String
|
||||
public var artistName: String
|
||||
public var artworkData: Data? // Small JPEG pre-fetched by the main app
|
||||
public var isPlaying: Bool
|
||||
public var playerName: String
|
||||
|
||||
public init(trackTitle: String, artistName: String, artworkData: Data?, isPlaying: Bool, playerName: String) {
|
||||
self.trackTitle = trackTitle
|
||||
self.artistName = artistName
|
||||
self.artworkData = artworkData
|
||||
self.isPlaying = isPlaying
|
||||
self.playerName = playerName
|
||||
}
|
||||
}
|
||||
|
||||
public init() {}
|
||||
}
|
||||
Reference in New Issue
Block a user