Skip to content

Migrate iOS plugin to Swift Package Manager#7

Open
elitree wants to merge 1 commit into
binSaed:mainfrom
elitree:feat/swift-package-manager-migration
Open

Migrate iOS plugin to Swift Package Manager#7
elitree wants to merge 1 commit into
binSaed:mainfrom
elitree:feat/swift-package-manager-migration

Conversation

@elitree

@elitree elitree commented Jun 9, 2026

Copy link
Copy Markdown

Summary

Adds Swift Package Manager support to the open_mail_app_plus iOS plugin, following Flutter's standard dual-support pattern (the same layout first-party plugins like url_launcher_ios use). The plugin now builds under both SPM and CocoaPods from a single shared set of source files.

Plugin changes (ios/)

  • New ios/open_mail_app_plus/Package.swift declaring the open_mail_app_plus target (iOS 12 min) and bundling PrivacyInfo.xcprivacy as a processed resource.
  • Moved sources into the SPM layout so SwiftPM can resolve them by convention:
    • ios/Classes/OpenMailAppPlusPlugin.swiftios/open_mail_app_plus/Sources/open_mail_app_plus/OpenMailAppPlusPlugin.swift
    • ios/Resources/PrivacyInfo.xcprivacyios/open_mail_app_plus/Sources/open_mail_app_plus/PrivacyInfo.xcprivacy
  • Updated open_mail_app_plus.podspec to read the same relocated sources (source_files + resource_bundles), so CocoaPods and SPM share one source of truth — no duplicated code.
  • Removed dead Objective-C boilerplate (OpenMailAppPlugin.h / .m). These were leftover template files referencing a non-existent OpenMailAppPlugin class (the .m even called itself recursively) and were never wired up — pubspec.yaml only registers OpenMailAppPlusPlugin.

Example app changes (example/ios/)

  • Restored the missing Podfile (+ generated Podfile.lock). The project still carried CocoaPods build phases but had no Podfile, so ${PODS_ROOT} resolved empty and the build failed with Unable to load contents of file list: '/Target Support Files/Pods-Runner/...'. With the Podfile back, pod install regenerates the xcfilelists and SPM + CocoaPods coexist as Flutter expects.

Incidental (Flutter tooling auto-migrations)

Running the example under the current Flutter SDK triggered standard project migrations that are included in the diff:

  • AppDelegate.swift adopts FlutterImplicitEngineDelegate for plugin registration.
  • Info.plist gains the UIApplicationSceneManifest (FlutterSceneDelegate) entries.
  • Minor AppFrameworkInfo.plist / project.pbxproj / scheme / lockfile updates.

Testing

  • swift package describe resolves the manifest, target, and privacy resource cleanly.
  • flutter run on an iOS simulator builds and launches the example successfully.

Resolves #6 .

@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 migrates the iOS plugin to a Swift Package Manager structure, updates the example app's iOS deployment target to 13.0, and integrates the new implicit Flutter engine delegate in the AppDelegate. Feedback recommends renaming the library in Package.swift to use underscores for consistency and uncommenting the platform version in the Podfile to match the project's deployment target.

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 ios/open_mail_app_plus/Package.swift
Comment thread example/ios/Podfile
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.

Add Swift Package Manager support

1 participant