From 0b18e09562af680834872a808b18d8769f4a6b60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Ali=20Ustao=C4=9Flu?= Date: Thu, 11 Jun 2026 19:39:33 +0200 Subject: [PATCH 1/3] feat(spm): add Package.swift to the Swift method-channel plugins Make the clean-Swift federated plugins consumable via Swift Package Manager (Flutter 3.44 default) alongside their existing podspec. Each manifest declares the FlutterFramework dependency (so the target can import Flutter), names the library product with hyphens, and reuses the same Classes/ sources the podspec compiles. flutter-tvos picks these up automatically and skips them in the Podfile so the two never double-link. Plugins: path_provider_tvos, shared_preferences_tvos, connectivity_plus_tvos, audioplayers_tvos, flutter_secure_storage_tvos. Verified end-to-end on the simulator (method-channel round-trip) and in a release build on a physical Apple TV. --- packages/audioplayers_tvos/tvos/Package.swift | 37 +++++++++++++++++++ .../connectivity_plus_tvos/tvos/Package.swift | 37 +++++++++++++++++++ .../tvos/Package.swift | 37 +++++++++++++++++++ .../path_provider_tvos/tvos/Package.swift | 37 +++++++++++++++++++ .../tvos/Package.swift | 37 +++++++++++++++++++ 5 files changed, 185 insertions(+) create mode 100644 packages/audioplayers_tvos/tvos/Package.swift create mode 100644 packages/connectivity_plus_tvos/tvos/Package.swift create mode 100644 packages/flutter_secure_storage_tvos/tvos/Package.swift create mode 100644 packages/path_provider_tvos/tvos/Package.swift create mode 100644 packages/shared_preferences_tvos/tvos/Package.swift diff --git a/packages/audioplayers_tvos/tvos/Package.swift b/packages/audioplayers_tvos/tvos/Package.swift new file mode 100644 index 0000000..1688a35 --- /dev/null +++ b/packages/audioplayers_tvos/tvos/Package.swift @@ -0,0 +1,37 @@ +// swift-tools-version: 5.9 +// Generated by `flutter-tvos plugin port`. Do not edit by hand. +// +// This manifest lets the package be consumed via Swift Package Manager. The +// target reuses the same `Classes/` sources the CocoaPods podspec compiles, so +// both dependency managers stay in sync from a single source tree. +import PackageDescription + +let package = Package( + name: "audioplayers_tvos", + platforms: [ + .tvOS(.v13), + ], + products: [ + .library(name: "audioplayers-tvos", targets: ["audioplayers_tvos"]), + ], + dependencies: [ + // Lets the target `import Flutter`. flutter-tvos generates a FlutterFramework + // package (binary target wrapping Flutter.xcframework) as a sibling of this + // package under the app's ephemeral SwiftPM packages, so `../FlutterFramework` + // resolves at build time. Matches stock Flutter's plugin Package.swift. + .package(name: "FlutterFramework", path: "../FlutterFramework"), + ], + targets: [ + .target( + name: "audioplayers_tvos", + dependencies: [ + .product(name: "FlutterFramework", package: "FlutterFramework"), + ], + path: "Classes", + swiftSettings: [ + // Keep Swift `#if TARGET_OS_TV` branches active, matching the podspec. + .define("TARGET_OS_TV"), + ] + ), + ] +) diff --git a/packages/connectivity_plus_tvos/tvos/Package.swift b/packages/connectivity_plus_tvos/tvos/Package.swift new file mode 100644 index 0000000..7f579f5 --- /dev/null +++ b/packages/connectivity_plus_tvos/tvos/Package.swift @@ -0,0 +1,37 @@ +// swift-tools-version: 5.9 +// Generated by `flutter-tvos plugin port`. Do not edit by hand. +// +// This manifest lets the package be consumed via Swift Package Manager. The +// target reuses the same `Classes/` sources the CocoaPods podspec compiles, so +// both dependency managers stay in sync from a single source tree. +import PackageDescription + +let package = Package( + name: "connectivity_plus_tvos", + platforms: [ + .tvOS(.v13), + ], + products: [ + .library(name: "connectivity-plus-tvos", targets: ["connectivity_plus_tvos"]), + ], + dependencies: [ + // Lets the target `import Flutter`. flutter-tvos generates a FlutterFramework + // package (binary target wrapping Flutter.xcframework) as a sibling of this + // package under the app's ephemeral SwiftPM packages, so `../FlutterFramework` + // resolves at build time. Matches stock Flutter's plugin Package.swift. + .package(name: "FlutterFramework", path: "../FlutterFramework"), + ], + targets: [ + .target( + name: "connectivity_plus_tvos", + dependencies: [ + .product(name: "FlutterFramework", package: "FlutterFramework"), + ], + path: "Classes", + swiftSettings: [ + // Keep Swift `#if TARGET_OS_TV` branches active, matching the podspec. + .define("TARGET_OS_TV"), + ] + ), + ] +) diff --git a/packages/flutter_secure_storage_tvos/tvos/Package.swift b/packages/flutter_secure_storage_tvos/tvos/Package.swift new file mode 100644 index 0000000..62c0c0c --- /dev/null +++ b/packages/flutter_secure_storage_tvos/tvos/Package.swift @@ -0,0 +1,37 @@ +// swift-tools-version: 5.9 +// Generated by `flutter-tvos plugin port`. Do not edit by hand. +// +// This manifest lets the package be consumed via Swift Package Manager. The +// target reuses the same `Classes/` sources the CocoaPods podspec compiles, so +// both dependency managers stay in sync from a single source tree. +import PackageDescription + +let package = Package( + name: "flutter_secure_storage_tvos", + platforms: [ + .tvOS(.v13), + ], + products: [ + .library(name: "flutter-secure-storage-tvos", targets: ["flutter_secure_storage_tvos"]), + ], + dependencies: [ + // Lets the target `import Flutter`. flutter-tvos generates a FlutterFramework + // package (binary target wrapping Flutter.xcframework) as a sibling of this + // package under the app's ephemeral SwiftPM packages, so `../FlutterFramework` + // resolves at build time. Matches stock Flutter's plugin Package.swift. + .package(name: "FlutterFramework", path: "../FlutterFramework"), + ], + targets: [ + .target( + name: "flutter_secure_storage_tvos", + dependencies: [ + .product(name: "FlutterFramework", package: "FlutterFramework"), + ], + path: "Classes", + swiftSettings: [ + // Keep Swift `#if TARGET_OS_TV` branches active, matching the podspec. + .define("TARGET_OS_TV"), + ] + ), + ] +) diff --git a/packages/path_provider_tvos/tvos/Package.swift b/packages/path_provider_tvos/tvos/Package.swift new file mode 100644 index 0000000..5f78137 --- /dev/null +++ b/packages/path_provider_tvos/tvos/Package.swift @@ -0,0 +1,37 @@ +// swift-tools-version: 5.9 +// Generated by `flutter-tvos plugin port`. Do not edit by hand. +// +// This manifest lets the package be consumed via Swift Package Manager. The +// target reuses the same `Classes/` sources the CocoaPods podspec compiles, so +// both dependency managers stay in sync from a single source tree. +import PackageDescription + +let package = Package( + name: "path_provider_tvos", + platforms: [ + .tvOS(.v13), + ], + products: [ + .library(name: "path-provider-tvos", targets: ["path_provider_tvos"]), + ], + dependencies: [ + // Lets the target `import Flutter`. flutter-tvos generates a FlutterFramework + // package (binary target wrapping Flutter.xcframework) as a sibling of this + // package under the app's ephemeral SwiftPM packages, so `../FlutterFramework` + // resolves at build time. Matches stock Flutter's plugin Package.swift. + .package(name: "FlutterFramework", path: "../FlutterFramework"), + ], + targets: [ + .target( + name: "path_provider_tvos", + dependencies: [ + .product(name: "FlutterFramework", package: "FlutterFramework"), + ], + path: "Classes", + swiftSettings: [ + // Keep Swift `#if TARGET_OS_TV` branches active, matching the podspec. + .define("TARGET_OS_TV"), + ] + ), + ] +) diff --git a/packages/shared_preferences_tvos/tvos/Package.swift b/packages/shared_preferences_tvos/tvos/Package.swift new file mode 100644 index 0000000..1c74bd8 --- /dev/null +++ b/packages/shared_preferences_tvos/tvos/Package.swift @@ -0,0 +1,37 @@ +// swift-tools-version: 5.9 +// Generated by `flutter-tvos plugin port`. Do not edit by hand. +// +// This manifest lets the package be consumed via Swift Package Manager. The +// target reuses the same `Classes/` sources the CocoaPods podspec compiles, so +// both dependency managers stay in sync from a single source tree. +import PackageDescription + +let package = Package( + name: "shared_preferences_tvos", + platforms: [ + .tvOS(.v13), + ], + products: [ + .library(name: "shared-preferences-tvos", targets: ["shared_preferences_tvos"]), + ], + dependencies: [ + // Lets the target `import Flutter`. flutter-tvos generates a FlutterFramework + // package (binary target wrapping Flutter.xcframework) as a sibling of this + // package under the app's ephemeral SwiftPM packages, so `../FlutterFramework` + // resolves at build time. Matches stock Flutter's plugin Package.swift. + .package(name: "FlutterFramework", path: "../FlutterFramework"), + ], + targets: [ + .target( + name: "shared_preferences_tvos", + dependencies: [ + .product(name: "FlutterFramework", package: "FlutterFramework"), + ], + path: "Classes", + swiftSettings: [ + // Keep Swift `#if TARGET_OS_TV` branches active, matching the podspec. + .define("TARGET_OS_TV"), + ] + ), + ] +) From ca5c193a9f3bebc31cfcb143e2daff21162877b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Ali=20Ustao=C4=9Flu?= Date: Thu, 11 Jun 2026 20:00:47 +0200 Subject: [PATCH 2/3] chore(spm): bump the SPM-enabled plugins to 0.0.2 Add a CHANGELOG entry and bump version 0.0.1 -> 0.0.2 for the five plugins that gained a tvos/Package.swift, so the Swift Package Manager support can be published to pub.dev. Additive, no API or behaviour change. Plugins: path_provider_tvos, shared_preferences_tvos, connectivity_plus_tvos, audioplayers_tvos, flutter_secure_storage_tvos. --- packages/audioplayers_tvos/CHANGELOG.md | 6 ++++++ packages/audioplayers_tvos/pubspec.yaml | 2 +- packages/connectivity_plus_tvos/CHANGELOG.md | 6 ++++++ packages/connectivity_plus_tvos/pubspec.yaml | 2 +- packages/flutter_secure_storage_tvos/CHANGELOG.md | 6 ++++++ packages/flutter_secure_storage_tvos/pubspec.yaml | 2 +- packages/path_provider_tvos/CHANGELOG.md | 6 ++++++ packages/path_provider_tvos/pubspec.yaml | 2 +- packages/shared_preferences_tvos/CHANGELOG.md | 6 ++++++ packages/shared_preferences_tvos/pubspec.yaml | 2 +- 10 files changed, 35 insertions(+), 5 deletions(-) diff --git a/packages/audioplayers_tvos/CHANGELOG.md b/packages/audioplayers_tvos/CHANGELOG.md index 9f6ec55..a7b76f3 100644 --- a/packages/audioplayers_tvos/CHANGELOG.md +++ b/packages/audioplayers_tvos/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.0.2 + +* Add Swift Package Manager support: ships a `tvos/Package.swift` so the + package can be consumed via SwiftPM (the Flutter 3.44 default) alongside the + existing CocoaPods podspec. No API or behaviour change. + ## 0.0.1 Initial release — tvOS implementation of `audioplayers` for diff --git a/packages/audioplayers_tvos/pubspec.yaml b/packages/audioplayers_tvos/pubspec.yaml index ee69054..33f82fc 100644 --- a/packages/audioplayers_tvos/pubspec.yaml +++ b/packages/audioplayers_tvos/pubspec.yaml @@ -1,6 +1,6 @@ name: audioplayers_tvos description: "tvOS (Apple TV) implementation of the audioplayers Flutter plugin, provided by flutter-tvos." -version: 0.0.1 +version: 0.0.2 homepage: https://fluttertv.dev repository: https://github.com/fluttertv/plugins/tree/main/packages/audioplayers_tvos issue_tracker: https://github.com/fluttertv/plugins/issues diff --git a/packages/connectivity_plus_tvos/CHANGELOG.md b/packages/connectivity_plus_tvos/CHANGELOG.md index 06b93aa..3170f79 100644 --- a/packages/connectivity_plus_tvos/CHANGELOG.md +++ b/packages/connectivity_plus_tvos/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.0.2 + +* Add Swift Package Manager support: ships a `tvos/Package.swift` so the + package can be consumed via SwiftPM (the Flutter 3.44 default) alongside the + existing CocoaPods podspec. No API or behaviour change. + ## 0.0.1 Initial release — tvOS implementation of `connectivity_plus` for diff --git a/packages/connectivity_plus_tvos/pubspec.yaml b/packages/connectivity_plus_tvos/pubspec.yaml index 25915f2..c2936c6 100644 --- a/packages/connectivity_plus_tvos/pubspec.yaml +++ b/packages/connectivity_plus_tvos/pubspec.yaml @@ -1,6 +1,6 @@ name: connectivity_plus_tvos description: "tvOS (Apple TV) implementation of the connectivity_plus Flutter plugin, provided by flutter-tvos." -version: 0.0.1 +version: 0.0.2 homepage: https://fluttertv.dev repository: https://github.com/fluttertv/plugins/tree/main/packages/connectivity_plus_tvos issue_tracker: https://github.com/fluttertv/plugins/issues diff --git a/packages/flutter_secure_storage_tvos/CHANGELOG.md b/packages/flutter_secure_storage_tvos/CHANGELOG.md index 307acc4..c081b07 100644 --- a/packages/flutter_secure_storage_tvos/CHANGELOG.md +++ b/packages/flutter_secure_storage_tvos/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.0.2 + +* Add Swift Package Manager support: ships a `tvos/Package.swift` so the + package can be consumed via SwiftPM (the Flutter 3.44 default) alongside the + existing CocoaPods podspec. No API or behaviour change. + ## 0.0.1 Initial release — tvOS implementation of `flutter_secure_storage` diff --git a/packages/flutter_secure_storage_tvos/pubspec.yaml b/packages/flutter_secure_storage_tvos/pubspec.yaml index 4e67623..c0464ff 100644 --- a/packages/flutter_secure_storage_tvos/pubspec.yaml +++ b/packages/flutter_secure_storage_tvos/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_secure_storage_tvos description: "tvOS (Apple TV) implementation of the flutter_secure_storage Flutter plugin, provided by flutter-tvos." -version: 0.0.1 +version: 0.0.2 homepage: https://fluttertv.dev repository: https://github.com/fluttertv/plugins/tree/main/packages/flutter_secure_storage_tvos issue_tracker: https://github.com/fluttertv/plugins/issues diff --git a/packages/path_provider_tvos/CHANGELOG.md b/packages/path_provider_tvos/CHANGELOG.md index 5490476..3ec9bc6 100644 --- a/packages/path_provider_tvos/CHANGELOG.md +++ b/packages/path_provider_tvos/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.0.2 + +* Add Swift Package Manager support: ships a `tvos/Package.swift` so the + package can be consumed via SwiftPM (the Flutter 3.44 default) alongside the + existing CocoaPods podspec. No API or behaviour change. + ## 0.0.1 Initial release — **hand-written, maintained** tvOS implementation of diff --git a/packages/path_provider_tvos/pubspec.yaml b/packages/path_provider_tvos/pubspec.yaml index a3970df..1630c71 100644 --- a/packages/path_provider_tvos/pubspec.yaml +++ b/packages/path_provider_tvos/pubspec.yaml @@ -1,6 +1,6 @@ name: path_provider_tvos description: "tvOS (Apple TV) implementation of the path_provider Flutter plugin, provided by flutter-tvos." -version: 0.0.1 +version: 0.0.2 homepage: https://fluttertv.dev repository: https://github.com/fluttertv/plugins/tree/main/packages/path_provider_tvos issue_tracker: https://github.com/fluttertv/plugins/issues diff --git a/packages/shared_preferences_tvos/CHANGELOG.md b/packages/shared_preferences_tvos/CHANGELOG.md index 3864af7..279e029 100644 --- a/packages/shared_preferences_tvos/CHANGELOG.md +++ b/packages/shared_preferences_tvos/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.0.2 + +* Add Swift Package Manager support: ships a `tvos/Package.swift` so the + package can be consumed via SwiftPM (the Flutter 3.44 default) alongside the + existing CocoaPods podspec. No API or behaviour change. + ## 0.0.1 Initial release — tvOS implementation of `shared_preferences` for diff --git a/packages/shared_preferences_tvos/pubspec.yaml b/packages/shared_preferences_tvos/pubspec.yaml index b4e5b73..ba23712 100644 --- a/packages/shared_preferences_tvos/pubspec.yaml +++ b/packages/shared_preferences_tvos/pubspec.yaml @@ -1,6 +1,6 @@ name: shared_preferences_tvos description: "tvOS (Apple TV) implementation of the shared_preferences Flutter plugin, provided by flutter-tvos." -version: 0.0.1 +version: 0.0.2 homepage: https://fluttertv.dev repository: https://github.com/fluttertv/plugins/tree/main/packages/shared_preferences_tvos issue_tracker: https://github.com/fluttertv/plugins/issues From 2bd16e499381439714360bc420bc8f6cfa6512bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Ali=20Ustao=C4=9Flu?= Date: Thu, 11 Jun 2026 20:03:38 +0200 Subject: [PATCH 3/3] docs(spm): note SwiftPM support + bump usage version to 0.0.2 Add a 'Dependency management' note to the five SPM-enabled plugin READMEs (both Swift Package Manager and CocoaPods are supported, wired automatically by flutter-tvos) and bump the usage example from ^0.0.1 to ^0.0.2 so the constraint actually picks up the SPM-enabled release (Dart caret ^0.0.1 resolves to <0.0.2). --- packages/audioplayers_tvos/README.md | 9 ++++++++- packages/connectivity_plus_tvos/README.md | 9 ++++++++- packages/flutter_secure_storage_tvos/README.md | 9 ++++++++- packages/path_provider_tvos/README.md | 9 ++++++++- packages/shared_preferences_tvos/README.md | 9 ++++++++- 5 files changed, 40 insertions(+), 5 deletions(-) diff --git a/packages/audioplayers_tvos/README.md b/packages/audioplayers_tvos/README.md index 559c656..1bca8f2 100644 --- a/packages/audioplayers_tvos/README.md +++ b/packages/audioplayers_tvos/README.md @@ -9,7 +9,7 @@ for [flutter-tvos](https://github.com/fluttertv/flutter-tvos) ```yaml dependencies: audioplayers: ^6.x - audioplayers_tvos: ^0.0.1 + audioplayers_tvos: ^0.0.2 ``` ## tvOS support @@ -31,3 +31,10 @@ dependencies: on tvOS); microphone-related options (no microphone). See `PORTING_REPORT.md` for the port detail and checklist. + +## Dependency management + +Supports both **Swift Package Manager** and **CocoaPods** from a single +source tree. `flutter-tvos` wires the right one automatically: apps on +Flutter 3.44+ link it via SwiftPM (this package ships a `tvos/Package.swift`), +while CocoaPods-based projects keep using the podspec. No manual setup needed. diff --git a/packages/connectivity_plus_tvos/README.md b/packages/connectivity_plus_tvos/README.md index ab5a6d7..0ee1cca 100644 --- a/packages/connectivity_plus_tvos/README.md +++ b/packages/connectivity_plus_tvos/README.md @@ -11,7 +11,7 @@ for [flutter-tvos](https://github.com/fluttertv/flutter-tvos). ```yaml dependencies: connectivity_plus: ^7.x - connectivity_plus_tvos: ^0.0.1 + connectivity_plus_tvos: ^0.0.2 ``` ## tvOS support @@ -29,3 +29,10 @@ dependencies: - Cellular detection (not applicable). See `PORTING_REPORT.md` for the port detail and checklist. + +## Dependency management + +Supports both **Swift Package Manager** and **CocoaPods** from a single +source tree. `flutter-tvos` wires the right one automatically: apps on +Flutter 3.44+ link it via SwiftPM (this package ships a `tvos/Package.swift`), +while CocoaPods-based projects keep using the podspec. No manual setup needed. diff --git a/packages/flutter_secure_storage_tvos/README.md b/packages/flutter_secure_storage_tvos/README.md index 692e864..db25d09 100644 --- a/packages/flutter_secure_storage_tvos/README.md +++ b/packages/flutter_secure_storage_tvos/README.md @@ -9,7 +9,7 @@ for [flutter-tvos](https://github.com/fluttertv/flutter-tvos) ```yaml dependencies: flutter_secure_storage: ^10.x - flutter_secure_storage_tvos: ^0.0.1 + flutter_secure_storage_tvos: ^0.0.2 ``` ## tvOS support @@ -32,3 +32,10 @@ dependencies: - Local Authentication (biometrics) — does not exist on tvOS. See `PORTING_REPORT.md` for the port detail and checklist. + +## Dependency management + +Supports both **Swift Package Manager** and **CocoaPods** from a single +source tree. `flutter-tvos` wires the right one automatically: apps on +Flutter 3.44+ link it via SwiftPM (this package ships a `tvos/Package.swift`), +while CocoaPods-based projects keep using the podspec. No manual setup needed. diff --git a/packages/path_provider_tvos/README.md b/packages/path_provider_tvos/README.md index 5ce4ebd..a967ac2 100644 --- a/packages/path_provider_tvos/README.md +++ b/packages/path_provider_tvos/README.md @@ -14,7 +14,7 @@ for [flutter-tvos](https://github.com/fluttertv/flutter-tvos). ```yaml dependencies: path_provider: ^2.x - path_provider_tvos: ^0.0.1 + path_provider_tvos: ^0.0.2 ``` ## tvOS support @@ -32,3 +32,10 @@ dependencies: - `getExternalStorage*` → `UnsupportedError` (Android-only, same as iOS). See `PORTING_REPORT.md` for detail. + +## Dependency management + +Supports both **Swift Package Manager** and **CocoaPods** from a single +source tree. `flutter-tvos` wires the right one automatically: apps on +Flutter 3.44+ link it via SwiftPM (this package ships a `tvos/Package.swift`), +while CocoaPods-based projects keep using the podspec. No manual setup needed. diff --git a/packages/shared_preferences_tvos/README.md b/packages/shared_preferences_tvos/README.md index f2f5b4b..708bc93 100644 --- a/packages/shared_preferences_tvos/README.md +++ b/packages/shared_preferences_tvos/README.md @@ -15,7 +15,7 @@ this package directly alongside it: ```yaml dependencies: shared_preferences: ^2.x - shared_preferences_tvos: ^0.0.1 + shared_preferences_tvos: ^0.0.2 ``` Use `shared_preferences` exactly as on iOS — the tvOS implementation @@ -34,3 +34,10 @@ registers automatically (it is `NSUserDefaults`-backed). - None. This plugin is fully functional on tvOS. See `PORTING_REPORT.md` for the port detail and checklist. + +## Dependency management + +Supports both **Swift Package Manager** and **CocoaPods** from a single +source tree. `flutter-tvos` wires the right one automatically: apps on +Flutter 3.44+ link it via SwiftPM (this package ships a `tvos/Package.swift`), +while CocoaPods-based projects keep using the podspec. No manual setup needed.