Add SPM support for iOS dependencies#916
Open
rickvdl wants to merge 6 commits into
Open
Conversation
ajpallares
reviewed
May 4, 2026
Member
ajpallares
left a comment
There was a problem hiding this comment.
Thanks for adding this!!
I have some comments. But my biggest concern is that the PR description mentions that using SPM is opt-in, while EDM4U 1.2.187 does this in its IOSResolver.cs
public static bool SwiftPackageManagerEnabled {
get { return settings.GetBool(PREFERENCE_SWIFT_PACKAGE_MANAGER_ENABLED,
defaultValue: true); }
...
}
which seems to mean that SPM is now enabled by default?
In fact, on CI, build-integration-tests-ios is actually disabling SPM, so it seems to be opt-out.
Comment on lines
+417
to
+419
| key: 1-pods-<< parameters.variant >>-{{ checksum "RevenueCat/Plugins/Editor/RevenueCatDependencies.xml" }} | ||
| paths: | ||
| - IntegrationTests/buildiOS/Pods | ||
| - IntegrationTests/buildiOS-<< parameters.variant >>/Pods |
Member
There was a problem hiding this comment.
Is there any point in restoring/saving the /Pods cache when variant is spm?
Comment on lines
411
to
414
| - run: | ||
| name: Install Pods | ||
| working_directory: IntegrationTests/buildiOS | ||
| working_directory: IntegrationTests/buildiOS-<< parameters.variant >> | ||
| command: bundle exec pod install --repo-update --verbose |
Member
There was a problem hiding this comment.
Should this step be skipped when variant is spm?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
CocoaPods is being deprecated. EDM4U 1.2.187 (Jan 2026) added Swift Package Manager support for iOS dependencies, so this PR offers SPM as a path forward.
PurchasesHybridCommonandPurchasesHybridCommonUIas<remoteSwiftPackage>entries in bothRevenueCatDependencies.xmlandRevenueCatUIDependencies.xml, alongside the existing<iosPods>entries.replacesPodso EDM4U strips the matching pods at resolve time when SPM is honored.#import <PurchasesHybridCommonUI/PurchasesHybridCommonUI-Swift.h>fromRevenueCatUI.m— the@import PurchasesHybridCommonUI;already exposes the same@objcsymbols via Clang modules, and the angle-bracket header doesn't exist under SPM. Matches the pattern used inpurchases-flutter.SwiftPackageManagerEnabledon by default so contributors test SPM going forward.update_hybrid_commonfastlane lane to also bump the SPM version, so future PHC bumps don't silently leave SPM pinned at an old version.build-integration-tests-iosandarchive-iosinto parameterized jobs that run in parallel — one variant per dependency manager — so both paths stay covered in CI.Customer impact
Existing CocoaPods customers are unaffected. EDM4U < 1.2.187 silently ignores the new
<remoteSwiftPackage>element and falls through to the existing<iosPod>entries, so their builds continue working unchanged.SPM is opt-in for now. Customers who want SPM need to update EDM4U to 1.2.187+ and enable the "Swift Package Manager Enabled" toggle in iOS Resolver settings. Once enabled, the `replacesPod` mechanism removes the pods from the generated Podfile and adds `purchases-hybrid-common.git` as an SPM dependency to the Xcode project.
Testing
Verified locally in the Subtester on a real iOS device, both with and without the SPM toggle enabled — CocoaPods and SPM both build and run successfully.
CI runs both paths in parallel and both archived cleanly. Verified the dependency manager actually used by inspecting the xcodebuild logs:
archive-ios-cocoapods— pulled PHC + PHC UI via CocoaPods.archive-ios-spm— resolved via Swift Package Manager:Required status checks (follow-up)
To avoid breaking branch protection, the SPM variants reuse the original job names (
build-integration-tests-iosandarchive-ios) — only the CocoaPods variants get explicit-cocoapodssuffixes. The existing required checks keep working unchanged.As a follow-up after merge, we should add
build-integration-tests-ios-cocoapodsandarchive-ios-cocoapodsto the required status checks list so the legacy path stays gated until we drop CocoaPods support entirely.