Skip to content

Chore: MOBILE-4162 - Upgrade Iterable SDKs & add Swift Package Manager support - #71

Closed
mabidakun wants to merge 37 commits into
la-haus:masterfrom
SpringCare:chore/MOBILE-4162-iterable-upgrade-spm
Closed

Chore: MOBILE-4162 - Upgrade Iterable SDKs & add Swift Package Manager support#71
mabidakun wants to merge 37 commits into
la-haus:masterfrom
SpringCare:chore/MOBILE-4162-iterable-upgrade-spm

Conversation

@mabidakun

Copy link
Copy Markdown
Contributor

MOBILE-4162

What does this PR do? 🧐

Upgrades the iterable_flutter plugin's native Iterable SDKs to the latest and adds Swift Package Manager (SPM) support, releasing v0.8.0.

Native SDK upgrades (to latest):

  • iOS Iterable-iOS-SDK 6.6.46.7.3 (includes the iOS 18 push-delivery-sandbox fix)
  • Android com.iterable:iterableapi 3.6.33.9.0
  • No breaking-change exposure: the plugin's Dart/native surface uses only stable APIs, and the only upstream removals (embedded-message tracking) aren't used here.

Swift Package Manager support:

  • Adds ios/iterable_flutter/Package.swift so the plugin can be consumed via SPM, alongside CocoaPods (Flutter falls back to CocoaPods when SPM is off).
  • Restructures the iOS sources to the SPM layout as a Swift-only target — removes the redundant Objective-C forwarding shim and renames SwiftIterableFlutterPluginIterableFlutterPlugin (registration still bridges to +registerWithRegistrar:).

Example app modernisation (required for the example to build under Flutter 3.44):

  • Android project migrated to Gradle 8.9 / AGP 8.7.3 / Kotlin 1.9.20 with the declarative plugins block (dropped dead jcenter()).
  • Replaced the abandoned, Flutter-3.44-incompatible flutter_config with flutter_dotenv (pure-Dart .env loader).

⚠️ Prerequisite for SPM to function — repository rename required

Flutter derives the Swift package identity from the plugin's repository folder basename, which must match the Dart package name (iterable_flutter). This repo is named iterable-flutter (hyphen), so SPM integration fails an identity check (unable to override package ... identity mismatch) until the repo is renamed iterable-flutteriterable_flutter. Proven by build tests across folder names.

CocoaPods is entirely unaffected, so the SDK upgrades are usable now regardless. Because v0.8.0 ships Package.swift, consumers should stay on CocoaPods until the rename, then adopt SPM.

Test Evidence

Scenario Result
iOS example builds under CocoaPods (Iterable 6.7.3) ✅ Xcode build done; Podfile.lockIterable-iOS-SDK (6.7.3)
iOS example builds under SPM (from a correctly-named folder) ✅ Xcode build done; SwiftPM resolves swift-sdk 6.7.3
Android example APK builds (iterableapi 3.9.0) ✅ Built app-debug.apk; manifest-blame → iterableapi:3.9.0
Plugin Android unit tests (NotificationParserTest) ✅ 3/3 pass
Dart tests (flutter test) ✅ 13/13 pass

How should this be manually tested? 🤓

  1. cd example && flutter pub get
  2. iOS (CocoaPods): cd ios && pod install then cd .. && flutter build ios --simulator --no-codesign → builds; Podfile.lock shows Iterable-iOS-SDK (6.7.3).
  3. Android: flutter build apk --debug → builds; gradle resolves com.iterable:iterableapi:3.9.0.
  4. Dart: from the repo root, flutter test → 13/13 pass.
  5. SPM (only after the repo is renamed to iterable_flutter): flutter config --enable-swift-package-manager then flutter build ios --simulator --no-codesign → SwiftPM resolves swift-sdk 6.7.3.

Any background context you want to provide? 🤗

  • The upstream La Haus iterable_flutter is abandoned; SpringCare maintains this fork.
  • The example modernisation was necessary because Flutter 3.44 rejects the example's legacy Android build (imperative plugin loader, AGP 7.0.0) and because flutter_config (latest, 2.0.2) still references Flutter's removed v1 Registrar, making it Android-incompatible.
  • Follow-ups (separate tickets):
    1. Org admin renames the repo iterable-flutteriterable_flutter (needed for SPM identity resolution).
    2. Update Cherubi's iterable_flutter git dependency to the new repo URL + ref: 0.8.0.
    3. Optionally enable Swift Package Manager app-wide in Cherubi.

mabidakun and others added 30 commits February 24, 2024 10:42
Chore: Update plugin to use Iterable Swift `6.5.7`
Chore: MOBILE -140 - Update to support Android 35
Chore: MOBILE-140 - update version 0.6.3
* Updated `MinimumOSVersion` and `IPHONEOS_DEPLOYMENT_TARGET` to 13.0 in relevant files.
* Bumped `Iterable-iOS-SDK` dependency to 6.6.4.
* Updated Swift version to 5.9.
* Adjusted `pubspec.yaml` version to 0.7.0.
* Bumped `minSdkVersion` from 16 to 21 to meet current requirements.
* Upgraded Iterable API dependency from `3.5.1` to `3.6.3` for improved functionality.
* Deleted the `.packages` file as it is deprecated in favor of `.dart_tool/package_config.json`.
* Removed various build artifacts related to Flutter and Iterable SDKs to clean up the project structure.
…le-SDKs

Chore: MOBILE-140 -  Upgrade iterable SDKs
Adds ios/iterable_flutter/Package.swift so the plugin can be consumed via
Swift Package Manager alongside CocoaPods (Flutter falls back to CocoaPods
when SPM is off). Verified: SwiftPM resolves Iterable's swift-sdk 6.7.3 and
the example builds under SPM. Also gitignores SPM build artifacts (.build/,
.swiftpm/).

PREREQUISITE — repo rename required for SPM to function:
Flutter derives the SwiftPM package identity from the plugin's repository
folder basename, which must match the Dart package name (iterable_flutter).
This repo is named iterable-flutter (hyphen), so SPM integration fails with
"unable to override package ... identity mismatch" until the repo is renamed
to iterable_flutter (and consumers update their git URL). Proven by build
tests across folder names. CocoaPods is unaffected.
@mabidakun

Copy link
Copy Markdown
Contributor Author

Closing — opened against the wrong repository by mistake. Reopening against SpringCare/iterable-flutter.

@mabidakun mabidakun closed this Jul 17, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modernizes the plugin by adding Swift Package Manager support, upgrading the iOS and Android Iterable SDKs, and updating the example app to use Gradle 8.9, AGP 8.7.3, and flutter_dotenv. Feedback on these changes highlights a Gradle configuration error in android/build.gradle where compileSdk is incorrectly placed inside defaultConfig. Additionally, it is recommended to specify a minimum Flutter SDK constraint in the example's pubspec.yaml to support the newly introduced APIs, and to ensure a placeholder .env file exists to prevent asset-not-found build failures.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread android/build.gradle
Comment on lines 27 to 47
android {
compileSdkVersion 31
if (project.hasProperty("android") && project.android.hasProperty("namespace")) {
namespace = "com.lahaus.iterable_flutter"
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
minSdkVersion 16
compileSdk 34
minSdkVersion 21
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

In Android Gradle Plugin (AGP), compileSdk is a property of the android block, not defaultConfig. Placing compileSdk 34 inside defaultConfig will cause a Gradle configuration error. Please move compileSdk 34 to the outer android block.

android {
    if (project.hasProperty("android") && project.android.hasProperty("namespace")) {
        namespace = "com.lahaus.iterable_flutter"
    }
    compileSdk 34

    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_1_8
    }

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }
    defaultConfig {
        minSdkVersion 21
    }

Comment thread example/pubspec.yaml
Comment on lines 8 to +9
environment:
sdk: ">=2.12.0 <3.0.0"
sdk: ">=3.0.0 <4.0.0"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The example app now uses FlutterImplicitEngineDelegate and UIApplicationSceneManifest (with FlutterSceneDelegate), which require Flutter 3.24 or newer. Running the example app on older Flutter 3.x versions will result in compilation or runtime errors. Consider adding a flutter SDK constraint to the environment block to enforce the minimum required Flutter version.

environment:
  sdk: ">=3.0.0 <4.0.0"
  flutter: ">=3.24.0"

Comment thread example/pubspec.yaml
Comment on lines +44 to +46
# The .env file is bundled as an asset and read at runtime by flutter_dotenv.
assets:
- .env

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

If the .env file is not committed to the repository (or is gitignored), listing it under assets in pubspec.yaml will cause the Flutter build to fail with an asset not found error. Consider committing a dummy .env file or a .env.example file, or ensure that a placeholder .env file is present in the repository so that the example app can be built immediately after cloning.

@mabidakun
mabidakun deleted the chore/MOBILE-4162-iterable-upgrade-spm branch July 17, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant