Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,43 @@ 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'

# 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:
FLUTTER_SWIFT_PACKAGE_MANAGER: ${{ matrix.swift-package-manager }}
run: flutter build ios --simulator --debug
27 changes: 23 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -50,9 +51,27 @@ 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.36.1'
```

`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

Expand Down
30 changes: 0 additions & 30 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -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: 312ba7a8088eb9cd0f5476ae3d6dd9b45c46b8c4
shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb
video_player_avfoundation: 3453f792138786248960ca029747fcd9f318ef52

PODFILE CHECKSUM: b6e248ac4c1eff5807c8b044b39b8bc326af3f5f

Expand Down
4 changes: 4 additions & 0 deletions ios/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ Icon?
/Flutter/Generated.xcconfig
/Flutter/ephemeral/
/Flutter/flutter_export_environment.sh

# Swift Package Manager
.build/
.swiftpm/
Empty file removed ios/Assets/.gitkeep
Empty file.
10 changes: 8 additions & 2 deletions ios/rees46_sdk.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ Flutter plugin wrapper around REES46 native SDK.
s.license = { :file => '../LICENSE' }
s.author = { 'REES46' => '[email protected]' }
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'
s.dependency 'REES46', '3.35.0'
# 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.36.1'
s.platform = :ios, '13.0'

# Flutter.framework does not contain a i386 slice.
Expand Down
29 changes: 29 additions & 0 deletions ios/rees46_sdk/Package.swift
Original file line number Diff line number Diff line change
@@ -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.36.1")
],
targets: [
.target(
name: "rees46_sdk",
dependencies: [
.product(name: "REES46", package: "ios-sdk")
],
resources: [
.process("PrivacyInfo.xcprivacy")
]
)
]
)
3 changes: 2 additions & 1 deletion pigeons/personalization_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ 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 {
Expand Down
Loading