Skip to content

Add Swift Package Manager support (iOS) + Android namespace cleanup - #81

Open
qMalte wants to merge 2 commits into
fryette:masterfrom
qMalte:feat/spm-support
Open

qMalte wants to merge 2 commits into
fryette:masterfrom
qMalte:feat/spm-support

Conversation

@qMalte

@qMalte qMalte commented Jul 5, 2026

Copy link
Copy Markdown

This PR bundles two independent changes from my fork.

1. Swift Package Manager support (iOS)

Adds a Swift package alongside the existing podspec so the plugin can be consumed via Flutter's Swift Package Manager. CocoaPods keeps working as a fallback and both build systems share the same sources (no duplication).

  • Add ios/webview_cookie_manager/Package.swift (target iOS 12.0)
  • Convert the plugin to pure Swift and rename SwiftWebviewCookieManagerPluginWebviewCookieManagerPlugin, dropping the Objective-C registration shim (SPM targets can't mix languages)
  • Move sources to ios/webview_cookie_manager/Sources/webview_cookie_manager/ and add a PrivacyInfo.xcprivacy manifest
  • Point the podspec source_files/resource_bundles at the new layout, clean up placeholder metadata, and bump the min iOS deployment to 12.0 (Flutter's current floor)
  • Ignore .build/ and .swiftpm/

No pubspec.yaml change is required — Flutter auto-detects Package.swift and pluginClass: WebviewCookieManagerPlugin stays valid.

Note on the min iOS bump

The deployment target moves from 11.0 to 12.0, which matches Flutter's current minimum. Happy to revisit if you'd prefer to keep 11.0.

2. Android: remove redundant namespace declaration

android/build.gradle declared namespace twice; removed the duplicate.

Testing

The SPM integration was verified by consuming this branch as a git dependency in a separate Flutter app with --enable-swift-package-manager and building for iOS.

Add a Swift package alongside the existing podspec so the plugin can be
consumed via Flutter's Swift Package Manager. CocoaPods keeps working as a
fallback and both build systems share the same sources.

- Add ios/webview_cookie_manager/Package.swift (target iOS 12.0)
- Convert the plugin to pure Swift and rename
  SwiftWebviewCookieManagerPlugin -> WebviewCookieManagerPlugin, dropping the
  Objective-C registration shim (SPM targets can't mix languages)
- Move sources to Sources/webview_cookie_manager/ and add PrivacyInfo.xcprivacy
- Point podspec source_files/resource_bundles at the new layout and clean up
  placeholder metadata; bump min iOS to 12.0
- Ignore .build/ and .swiftpm/
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