diff --git a/Shared/Storage/WidgetSharedState.swift b/Shared/Storage/WidgetSharedState.swift index 82ab7e2..a28099b 100644 --- a/Shared/Storage/WidgetSharedState.swift +++ b/Shared/Storage/WidgetSharedState.swift @@ -8,7 +8,7 @@ import Foundation // Reads/writes playback state via App Group UserDefaults so the widget // can display current song info and the app can receive widget commands. // -// App Group: "group.ca.dallasgroot.NavidromePlayer" +// App Group: "group.com.navidromeplayer.shared" // Add this App Group capability to BOTH targets in Signing & Capabilities. // ────────────────────────────────────────────────────────────────────── @@ -40,7 +40,7 @@ let kWidgetCommandNotification = "ca.dallasgroot.NavidromePlayer.widgetCommand" /// Widget AppIntents call `enqueueCommand(...)` then post a Darwin notification. final class WidgetSharedState { - static let suiteName = "group.ca.dallasgroot.NavidromePlayer" + static let suiteName = "group.com.navidromeplayer.shared" static let shared = WidgetSharedState() private let defaults: UserDefaults? diff --git a/Widget/NavidromeWidget.entitlements b/Widget/NavidromeWidget.entitlements new file mode 100644 index 0000000..34da8c1 --- /dev/null +++ b/Widget/NavidromeWidget.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.application-groups + + group.com.navidromeplayer.shared + + + diff --git a/project.yml b/project.yml index c7da516..8927508 100644 --- a/project.yml +++ b/project.yml @@ -46,6 +46,8 @@ targets: dependencies: - target: NavidromeWatch embed: true + - target: NavidromeWidget + embed: true - package: ZIPFoundation # ───────────────────────────────────── @@ -69,12 +71,36 @@ targets: WATCHOS_DEPLOYMENT_TARGET: "26.0" SKIP_INSTALL: true + # ───────────────────────────────────── + # Widget Extension + # ───────────────────────────────────── + NavidromeWidget: + type: appExtension + platform: iOS + deploymentTarget: "17.0" + sources: + - path: Widget + excludes: + - "*.entitlements" + - path: Shared/Storage/WidgetSharedState.swift + settings: + base: + PRODUCT_BUNDLE_IDENTIFIER: ca.dallasgroot.navidromeplayer.app.widget + PRODUCT_NAME: NavidromeWidget + GENERATE_INFOPLIST_FILE: YES + INFOPLIST_KEY_CFBundleDisplayName: NavidromePlayer + INFOPLIST_KEY_NSExtension_NSExtensionPointIdentifier: com.apple.widgetkit-extension + CODE_SIGN_ENTITLEMENTS: Widget/NavidromeWidget.entitlements + SWIFT_EMIT_LOC_STRINGS: "YES" + SKIP_INSTALL: true + schemes: NavidromePlayer: build: targets: NavidromePlayer: all NavidromeWatch: all + NavidromeWidget: all run: config: Debug test: