Skip to content

feat(social_share): add Swift Package Manager support - #1

Merged
freakness merged 2 commits into
mainfrom
feat/social-share-swift-package-manager
Jun 16, 2026
Merged

feat(social_share): add Swift Package Manager support#1
freakness merged 2 commits into
mainfrom
feat/social-share-swift-package-manager

Conversation

@freakness

Copy link
Copy Markdown
Collaborator

Summary

Converts the appinio_social_share iOS plugin to support Swift Package Manager alongside CocoaPods, following the Flutter SwiftPM migration guide for plugin authors. Also includes the prior chore: update to flutter 3.44.2 commit.

Changes

SwiftPM package (ios/appinio_social_share/)

  • New Package.swift (swift-tools 5.9, iOS 12.0) depending on FlutterFramework and facebook-ios-sdk (FacebookCore + FacebookShare products, pinned to exact: 17.0.2)
  • Sources moved from ios/Classes/ios/appinio_social_share/Sources/appinio_social_share/

Mixed Objective-C + Swift → pure Swift (SwiftPM targets are single-language)

  • Removed the Objective-C registration shim (AppinioSocialSharePlugin.h/.m)
  • Renamed SwiftAppinioSocialSharePluginAppinioSocialSharePlugin, exposed via @objc(AppinioSocialSharePlugin) so Flutter's generated registrant still resolves it (no pluginClass change needed)
  • Added explicit import Flutter / import UIKit to ShareUtil.swift (previously relied on CocoaPods' implicit cross-file module visibility)

CocoaPods (kept working in parallel)

  • appinio_social_share.podspec: updated source_files path; bumped s.platform 9.012.0 to match the Facebook SDK

Misc

  • .gitignore: added .build/ and .swiftpm/
  • Example app: SwiftPM workspace integration + Flutter 3.44 UIScene-lifecycle auto-migration

Verification

  • SwiftPM: flutter build ios --no-codesign✓ Built Runner.app; Flutter reports "All plugins found for ios are Swift Packages."
  • CocoaPods: pod lib lint ios/appinio_social_share.podspec --use-libraries --use-modular-headerspassed validation (only pre-existing/unrelated warnings)

🤖 Generated with Claude Code

freakness and others added 2 commits June 16, 2026 16:12
Convert the appinio_social_share iOS plugin to support Swift Package
Manager alongside CocoaPods, per the Flutter SwiftPM migration guide.

- Add ios/appinio_social_share/Package.swift depending on FlutterFramework
  and the facebook-ios-sdk (FacebookCore + FacebookShare, pinned to 17.0.2)
- Move Swift sources from ios/Classes to the SwiftPM target layout
- Fold the Objective-C registration shim into the Swift plugin class
  (rename SwiftAppinioSocialSharePlugin -> AppinioSocialSharePlugin,
  exposed via @objc) since SwiftPM targets are single-language
- Add explicit Flutter/UIKit imports to ShareUtil.swift
- Update the podspec source_files path and bump the deployment target to
  iOS 12 to match the Facebook SDK
- Ignore .build/ and .swiftpm/

Verified with both an SwiftPM build (flutter build ios) and a CocoaPods
lint (pod lib lint).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 16, 2026 14:40
@freakness
freakness requested a review from a team as a code owner June 16, 2026 14:40
@freakness
freakness merged commit 90e1aaf into main Jun 16, 2026
1 check passed

Copilot AI 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.

Pull request overview

This PR migrates the appinio_social_share iOS implementation to support Swift Package Manager (alongside CocoaPods), aligning the plugin structure with Flutter’s SwiftPM guidance and updating the example iOS app/project files for Flutter 3.44.2’s SwiftPM/scene lifecycle changes.

Changes:

  • Added an iOS SwiftPM Package.swift and relocated plugin Swift sources into ios/appinio_social_share/Sources/....
  • Removed the Objective-C registration shim and renamed the Swift plugin class to AppinioSocialSharePlugin with @objc(...) exposure for Flutter registration.
  • Updated CocoaPods podspec paths + iOS deployment target, and adjusted the example app’s iOS workspace/project to integrate SwiftPM.

Reviewed changes

Copilot reviewed 16 out of 19 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/appinio_social_share/ios/Classes/AppinioSocialSharePlugin.m Removes Obj-C registration shim (Swift-only target compatibility).
packages/appinio_social_share/ios/Classes/AppinioSocialSharePlugin.h Removes Obj-C header for the deprecated shim.
packages/appinio_social_share/ios/appinio_social_share/Sources/appinio_social_share/ShareUtil.swift Adds explicit imports needed under SwiftPM compilation.
packages/appinio_social_share/ios/appinio_social_share/Sources/appinio_social_share/MyActivityItemSource.swift Introduces a new UIActivityItemSource helper for richer share sheet metadata.
packages/appinio_social_share/ios/appinio_social_share/Sources/appinio_social_share/AppinioSocialSharePlugin.swift Renames and re-exposes the plugin class for SwiftPM + Flutter registrant compatibility.
packages/appinio_social_share/ios/appinio_social_share/Package.swift Adds SwiftPM manifest for the plugin (FlutterFramework + Facebook SDK).
packages/appinio_social_share/ios/appinio_social_share.podspec Updates CocoaPods file glob + bumps iOS platform to 12.0.
packages/appinio_social_share/example/pubspec.lock Updates resolved Dart/Flutter transitive deps for the example.
packages/appinio_social_share/example/ios/Runner/Info.plist Updates example Info.plist for scene-based lifecycle.
packages/appinio_social_share/example/ios/Runner/AppDelegate.swift Updates example AppDelegate for implicit engine initialization registration.
packages/appinio_social_share/example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved Adds SwiftPM resolution state for the workspace.
packages/appinio_social_share/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme Adds pre-build action to prepare Flutter frameworks for SwiftPM integration.
packages/appinio_social_share/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved Adds SwiftPM resolution state for the project workspace.
packages/appinio_social_share/example/ios/Runner.xcodeproj/project.pbxproj Integrates Flutter SwiftPM packages and related build settings into the Xcode project.
packages/appinio_social_share/example/ios/Podfile.lock Updates lockfile to reflect the new dependency integration approach.
packages/appinio_social_share/example/ios/Flutter/AppFrameworkInfo.plist Adjusts framework plist entries as part of Flutter template/migration changes.
packages/appinio_social_share/.gitignore Ignores SwiftPM build metadata directories.
.vscode/settings.json Updates local Flutter SDK path (FVM) to 3.44.2.
.fvmrc Pins Flutter version to 3.44.2.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants