From cd86a05f4ed2d48ddf2e031a55c8637428a8533b Mon Sep 17 00:00:00 2001 From: andreykropotov Date: Mon, 26 Oct 2026 18:14:20 +0400 Subject: [PATCH 1/9] feat(ios): plugin builds through Swift Package Manager The sources move to ios/rees46_sdk/Sources/rees46_sdk, where Flutter expects a Swift package, and ios/rees46_sdk/Package.swift takes the native SDK from its repository tag. The podspec builds the same files for apps with Swift Package Manager support off. --- ios/.gitignore | 4 +++ ios/Assets/.gitkeep | 0 ios/rees46_sdk.podspec | 8 ++++- ios/rees46_sdk/Package.swift | 29 +++++++++++++++++++ .../Sources/rees46_sdk}/PrivacyInfo.xcprivacy | 0 .../rees46_sdk}/Rees46FlutterSdkPlugin.swift | 0 .../Sources/rees46_sdk}/StoriesSupport.swift | 0 .../pigeon/PersonalizationApi.g.swift | 0 pigeons/personalization_api.dart | 2 +- 9 files changed, 41 insertions(+), 2 deletions(-) delete mode 100644 ios/Assets/.gitkeep create mode 100644 ios/rees46_sdk/Package.swift rename ios/{Resources => rees46_sdk/Sources/rees46_sdk}/PrivacyInfo.xcprivacy (100%) rename ios/{Classes => rees46_sdk/Sources/rees46_sdk}/Rees46FlutterSdkPlugin.swift (100%) rename ios/{Classes => rees46_sdk/Sources/rees46_sdk}/StoriesSupport.swift (100%) rename ios/{Classes => rees46_sdk/Sources/rees46_sdk}/pigeon/PersonalizationApi.g.swift (100%) diff --git a/ios/.gitignore b/ios/.gitignore index 034771f..e7a7b08 100644 --- a/ios/.gitignore +++ b/ios/.gitignore @@ -36,3 +36,7 @@ Icon? /Flutter/Generated.xcconfig /Flutter/ephemeral/ /Flutter/flutter_export_environment.sh + +# Swift Package Manager +.build/ +.swiftpm/ diff --git a/ios/Assets/.gitkeep b/ios/Assets/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/ios/rees46_sdk.podspec b/ios/rees46_sdk.podspec index 01211c0..9f0489d 100644 --- a/ios/rees46_sdk.podspec +++ b/ios/rees46_sdk.podspec @@ -12,8 +12,14 @@ Flutter plugin wrapper around REES46 native SDK. s.license = { :file => '../LICENSE' } s.author = { 'REES46' => 'support@rees46.com' } s.source = { :path => '.' } - s.source_files = 'Classes/**/*' + # The sources live where Swift Package Manager expects them (rees46_sdk/Package.swift); + # CocoaPods builds the same files. + s.source_files = 'rees46_sdk/Sources/rees46_sdk/**/*.swift' + s.resource_bundles = {'rees46_sdk_privacy' => ['rees46_sdk/Sources/rees46_sdk/PrivacyInfo.xcprivacy']} s.dependency 'Flutter' + # Keep in step with the dependency in rees46_sdk/Package.swift. CocoaPods trunk is + # read-only, so a version newer than the last one there resolves only through the + # app's Podfile (see "iOS" in README.md). s.dependency 'REES46', '3.35.0' s.platform = :ios, '13.0' diff --git a/ios/rees46_sdk/Package.swift b/ios/rees46_sdk/Package.swift new file mode 100644 index 0000000..546a934 --- /dev/null +++ b/ios/rees46_sdk/Package.swift @@ -0,0 +1,29 @@ +// swift-tools-version: 5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "rees46_sdk", + platforms: [ + .iOS("13.0") + ], + products: [ + .library(name: "rees46-sdk", targets: ["rees46_sdk"]) + ], + dependencies: [ + // Keep in step with the dependency in ../rees46_sdk.podspec. + .package(url: "https://github.com/rees46/ios-sdk.git", exact: "3.35.0") + ], + targets: [ + .target( + name: "rees46_sdk", + dependencies: [ + .product(name: "REES46", package: "ios-sdk") + ], + resources: [ + .process("PrivacyInfo.xcprivacy") + ] + ) + ] +) diff --git a/ios/Resources/PrivacyInfo.xcprivacy b/ios/rees46_sdk/Sources/rees46_sdk/PrivacyInfo.xcprivacy similarity index 100% rename from ios/Resources/PrivacyInfo.xcprivacy rename to ios/rees46_sdk/Sources/rees46_sdk/PrivacyInfo.xcprivacy diff --git a/ios/Classes/Rees46FlutterSdkPlugin.swift b/ios/rees46_sdk/Sources/rees46_sdk/Rees46FlutterSdkPlugin.swift similarity index 100% rename from ios/Classes/Rees46FlutterSdkPlugin.swift rename to ios/rees46_sdk/Sources/rees46_sdk/Rees46FlutterSdkPlugin.swift diff --git a/ios/Classes/StoriesSupport.swift b/ios/rees46_sdk/Sources/rees46_sdk/StoriesSupport.swift similarity index 100% rename from ios/Classes/StoriesSupport.swift rename to ios/rees46_sdk/Sources/rees46_sdk/StoriesSupport.swift diff --git a/ios/Classes/pigeon/PersonalizationApi.g.swift b/ios/rees46_sdk/Sources/rees46_sdk/pigeon/PersonalizationApi.g.swift similarity index 100% rename from ios/Classes/pigeon/PersonalizationApi.g.swift rename to ios/rees46_sdk/Sources/rees46_sdk/pigeon/PersonalizationApi.g.swift diff --git a/pigeons/personalization_api.dart b/pigeons/personalization_api.dart index 45adef9..c53095a 100644 --- a/pigeons/personalization_api.dart +++ b/pigeons/personalization_api.dart @@ -12,7 +12,7 @@ import 'package:pigeon/pigeon.dart'; kotlinOptions: KotlinOptions( package: 'com.rees46.rees46_flutter_sdk.pigeon', ), - swiftOut: 'ios/Classes/pigeon/PersonalizationApi.g.swift', + swiftOut: 'ios/rees46_sdk/Sources/rees46_sdk/pigeon/PersonalizationApi.g.swift', ), ) class InitConfig { From 70cc05ec57bf127567a17163fe4926af8812b8c4 Mon Sep 17 00:00:00 2001 From: andreykropotov Date: Mon, 26 Oct 2026 18:14:20 +0400 Subject: [PATCH 2/9] ci: build the iOS example through Swift Package Manager and CocoaPods --- .github/workflows/checks.yaml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 1e9a132..3b0ab92 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -60,3 +60,29 @@ jobs: - name: Build (verify) working-directory: example run: flutter build apk --debug + + # The iOS plugin is built two ways: through its Swift package (Flutter's default + # since 3.44), and through the podspec, which apps with Swift Package Manager + # support turned off still use. Both point at the same sources and the same + # native SDK version, and either can drift on its own. + ios: + if: github.event.pull_request.draft == false + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + swift-package-manager: ['true', 'false'] + + steps: + - uses: actions/checkout@v4 + + - uses: subosito/flutter-action@v2 + with: + flutter-version: '3.44.0' + channel: 'stable' + + - name: Build the example for the simulator + working-directory: example + env: + FLUTTER_SWIFT_PACKAGE_MANAGER: ${{ matrix.swift-package-manager }} + run: flutter build ios --simulator --debug From b56d40f382ed4af05ced3089cdf8b5f312f88fa3 Mon Sep 17 00:00:00 2001 From: andreykropotov Date: Mon, 26 Oct 2026 18:14:20 +0400 Subject: [PATCH 3/9] docs: iOS setup without CocoaPods trunk --- README.md | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b46724b..401b0a9 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,8 @@ import 'package:rees46_sdk/rees46_sdk.dart'; ``` The native dependencies come with it — `com.github.rees46:android-sdk` from -JitPack and the `REES46` pod from CocoaPods trunk. +JitPack and the [iOS SDK](https://github.com/rees46/ios-sdk) through Swift Package +Manager or CocoaPods. ### Android @@ -50,9 +51,25 @@ maven(url = "https://jitpack.io") ### iOS -Nothing to add: the plugin's podspec pulls the `REES46` pod and declares the -iOS 13.0 minimum itself, `pod install` runs as part of `flutter run`, and the -plugin registers its own application delegate — your `AppDelegate` stays untouched. +The plugin declares the iOS 13.0 minimum itself and registers its own application +delegate — your `AppDelegate` stays untouched. + +**With Swift Package Manager** — the default since Flutter 3.44, and on earlier +versions after `flutter config --enable-swift-package-manager` — there is nothing to +add: the plugin's package pulls the native SDK. + +**With CocoaPods** (Swift Package Manager support turned off, or Flutter older than +3.44 without the setting above) add the native pod to `ios/Podfile`, inside +`target 'Runner'`. CocoaPods trunk is +read-only since 2 December 2026, so the pod is taken straight from its repository. +The tag is the version the plugin requires — the `REES46` dependency in +[`ios/rees46_sdk.podspec`](ios/rees46_sdk.podspec): + +```ruby +pod 'REES46', :git => 'https://github.com/rees46/ios-sdk.git', :tag => 'v3.35.0' +``` + +`pod install` then runs as part of `flutter run`. ## Initialize From 364015128c6e14b5ebb89cc981ae895ea815ca70 Mon Sep 17 00:00:00 2001 From: andreykropotov Date: Mon, 26 Oct 2026 18:15:09 +0400 Subject: [PATCH 4/9] chore(example): Podfile.lock follows the moved plugin sources --- example/ios/Podfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 1b01487..56af6c3 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -51,7 +51,7 @@ SPEC CHECKSUMS: integration_test: 4a889634ef21a45d28d50d622cf412dc6d9f586e patrol: cea8074f183a2a4232d0ebd10569ae05149ada42 REES46: a96357df1dbbef9a73d92961069290702334136d - rees46_sdk: 312ba7a8088eb9cd0f5476ae3d6dd9b45c46b8c4 + rees46_sdk: 16e4583a20206f42c013b38d63a4935fa34ba197 shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb video_player_avfoundation: 3453f792138786248960ca029747fcd9f318ef52 From 0590a08a978c82082b9f0b09851b29e83464dfcd Mon Sep 17 00:00:00 2001 From: andreykropotov Date: Mon, 26 Oct 2026 19:22:18 +0400 Subject: [PATCH 5/9] fix(ios): native SDK 3.36.1 3.36.1 keeps the device id when an app moves from CocoaPods to Swift Package Manager, and loads the search widget's strings from the package bundle. It is not on CocoaPods trunk. --- ios/rees46_sdk.podspec | 2 +- ios/rees46_sdk/Package.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/rees46_sdk.podspec b/ios/rees46_sdk.podspec index 9f0489d..296010d 100644 --- a/ios/rees46_sdk.podspec +++ b/ios/rees46_sdk.podspec @@ -20,7 +20,7 @@ Flutter plugin wrapper around REES46 native SDK. # Keep in step with the dependency in rees46_sdk/Package.swift. CocoaPods trunk is # read-only, so a version newer than the last one there resolves only through the # app's Podfile (see "iOS" in README.md). - s.dependency 'REES46', '3.35.0' + s.dependency 'REES46', '3.36.1' s.platform = :ios, '13.0' # Flutter.framework does not contain a i386 slice. diff --git a/ios/rees46_sdk/Package.swift b/ios/rees46_sdk/Package.swift index 546a934..ae48507 100644 --- a/ios/rees46_sdk/Package.swift +++ b/ios/rees46_sdk/Package.swift @@ -13,7 +13,7 @@ let package = Package( ], dependencies: [ // Keep in step with the dependency in ../rees46_sdk.podspec. - .package(url: "https://github.com/rees46/ios-sdk.git", exact: "3.35.0") + .package(url: "https://github.com/rees46/ios-sdk.git", exact: "3.36.1") ], targets: [ .target( From d5275e5bbe132959e1a88a1bd7050dabc6738803 Mon Sep 17 00:00:00 2001 From: andreykropotov Date: Mon, 26 Oct 2026 19:22:18 +0400 Subject: [PATCH 6/9] ci: CocoaPods build takes the native pod from its repository --- .github/workflows/checks.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/checks.yaml b/.github/workflows/checks.yaml index 3b0ab92..06aeb0d 100644 --- a/.github/workflows/checks.yaml +++ b/.github/workflows/checks.yaml @@ -81,6 +81,20 @@ jobs: flutter-version: '3.44.0' channel: 'stable' + # CocoaPods trunk is read-only, so an app building plugins through CocoaPods + # adds the native pod from its repository, as README.md tells it to. The + # example's Podfile cannot keep that line: with Swift Package Manager on it + # would link the SDK a second time. + - name: Take the native pod from its repository + if: matrix.swift-package-manager == 'false' + working-directory: example/ios + run: | + version=$(sed -n "s/^ *s.dependency 'REES46', '\(.*\)'$/\1/p" ../../ios/rees46_sdk.podspec) + line=" pod 'REES46', :git => 'https://github.com/rees46/ios-sdk.git', :tag => 'v$version'" + awk -v line="$line" '{ print } /^target .Runner. do/ { print line }' Podfile > Podfile.new + mv Podfile.new Podfile + grep -n "pod 'REES46'" Podfile + - name: Build the example for the simulator working-directory: example env: From 5b7262d2886421f680cff43c560cae7665895767 Mon Sep 17 00:00:00 2001 From: andreykropotov Date: Mon, 26 Oct 2026 19:22:18 +0400 Subject: [PATCH 7/9] docs: CocoaPods tag follows the plugin, dropped with Swift Package Manager --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 401b0a9..18c2a23 100644 --- a/README.md +++ b/README.md @@ -66,10 +66,12 @@ The tag is the version the plugin requires — the `REES46` dependency in [`ios/rees46_sdk.podspec`](ios/rees46_sdk.podspec): ```ruby -pod 'REES46', :git => 'https://github.com/rees46/ios-sdk.git', :tag => 'v3.35.0' +pod 'REES46', :git => 'https://github.com/rees46/ios-sdk.git', :tag => 'v3.36.1' ``` -`pod install` then runs as part of `flutter run`. +`pod install` then runs as part of `flutter run`. Update the tag together with the +plugin, and drop the line once Swift Package Manager support is on — the plugin's +package brings the SDK then, and keeping the pod would link it twice. ## Initialize From b065c6c342ca2ba201f1037d13d9f3abab462229 Mon Sep 17 00:00:00 2001 From: andreykropotov Date: Mon, 26 Oct 2026 19:22:18 +0400 Subject: [PATCH 8/9] chore(example): Podfile.lock from a Swift Package Manager build A CocoaPods build needs the native pod from its repository now, a line the example's Podfile does not keep; the lock is what the default Swift Package Manager build leaves. --- example/ios/Podfile.lock | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 56af6c3..f48e06f 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1,59 +1,29 @@ PODS: - CocoaAsyncSocket (7.6.5) - Flutter (1.0.0) - - integration_test (0.0.1): - - Flutter - patrol (0.0.1): - CocoaAsyncSocket (~> 7.6) - Flutter - FlutterMacOS - - REES46 (3.35.0) - - rees46_sdk (0.0.1): - - Flutter - - REES46 (= 3.35.0) - - shared_preferences_foundation (0.0.1): - - Flutter - - FlutterMacOS - - video_player_avfoundation (0.0.1): - - Flutter - - FlutterMacOS DEPENDENCIES: - Flutter (from `Flutter`) - - integration_test (from `.symlinks/plugins/integration_test/ios`) - patrol (from `.symlinks/plugins/patrol/darwin`) - - rees46_sdk (from `.symlinks/plugins/rees46_sdk/ios`) - - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) - - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`) SPEC REPOS: trunk: - CocoaAsyncSocket - - REES46 EXTERNAL SOURCES: Flutter: :path: Flutter - integration_test: - :path: ".symlinks/plugins/integration_test/ios" patrol: :path: ".symlinks/plugins/patrol/darwin" - rees46_sdk: - :path: ".symlinks/plugins/rees46_sdk/ios" - shared_preferences_foundation: - :path: ".symlinks/plugins/shared_preferences_foundation/darwin" - video_player_avfoundation: - :path: ".symlinks/plugins/video_player_avfoundation/darwin" SPEC CHECKSUMS: CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 Flutter: cabc95a1d2626b1b06e7179b784ebcf0c0cde467 - integration_test: 4a889634ef21a45d28d50d622cf412dc6d9f586e patrol: cea8074f183a2a4232d0ebd10569ae05149ada42 - REES46: a96357df1dbbef9a73d92961069290702334136d - rees46_sdk: 16e4583a20206f42c013b38d63a4935fa34ba197 - shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb - video_player_avfoundation: 3453f792138786248960ca029747fcd9f318ef52 PODFILE CHECKSUM: b6e248ac4c1eff5807c8b044b39b8bc326af3f5f From 4ff2e200434ba74a3297f63bf4bd00aaf627b4d9 Mon Sep 17 00:00:00 2001 From: andreykropotov Date: Mon, 26 Oct 2026 19:32:00 +0400 Subject: [PATCH 9/9] style: format the pigeon output path --- pigeons/personalization_api.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pigeons/personalization_api.dart b/pigeons/personalization_api.dart index c53095a..ac51e20 100644 --- a/pigeons/personalization_api.dart +++ b/pigeons/personalization_api.dart @@ -12,7 +12,8 @@ import 'package:pigeon/pigeon.dart'; kotlinOptions: KotlinOptions( package: 'com.rees46.rees46_flutter_sdk.pigeon', ), - swiftOut: 'ios/rees46_sdk/Sources/rees46_sdk/pigeon/PersonalizationApi.g.swift', + swiftOut: + 'ios/rees46_sdk/Sources/rees46_sdk/pigeon/PersonalizationApi.g.swift', ), ) class InitConfig {