feat(ios): declare FronteggSwift via React Native's spm_dependency helper — unblocks multi-target (white-label) workspaces - #99
Closed
airowe wants to merge 1 commit into
Conversation
…lper (multi-target workspaces)
ios/frontegg_spm.rb text-patches the host's Pods.xcodeproj with object
IDs sized for a single app target. Workspaces with many app targets
(white-label products build dozens from one workspace) can't use it —
the script writes references for a target layout that doesn't match.
React Native >= 0.75 ships an official mechanism for exactly this:
spm_dependency() in a library podspec, applied by
react_native_post_install to every target that consumes the pod, with
no pbxproj text manipulation. Declare FronteggSwift there, guarded by
defined?() so autolinking's out-of-process [!] A specification path is required.
Usage:
$ pod ipc spec PATH
Converts a podspec to JSON and prints it to STDOUT.
Options:
--allow-root Allows CocoaPods to run as root
--silent Show nothing
--verbose Show more debugging information
--no-ansi Show output without ANSI codes
--help Show help banner of specified command evaluation
(which doesn't load react_native_pods.rb) still parses the spec;
frontegg_spm.rb remains the documented fallback for older RN.
Validated on a 50-target workspace (RN 0.81.5, static linkage):
pod install injects one XCRemoteSwiftPackageReference; Debug and
Release builds of two app targets with different team/bundle IDs
succeed with no per-target configuration.
airowe
marked this pull request as ready for review
July 22, 2026 13:10
Collaborator
|
Superseded by #103 — recreated as a Frontegg-owned branch, rebased on current |
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.
Problem
Since FronteggSwift went SPM-only (1.2.18+),
ios/frontegg_spm.rblinks it by text-patching the host app'sPods.xcodeprojwith hardcoded object IDs sized for a single app target (+ test targets). Workspaces with many app targets can't use it: white-label products build dozens of apps from one workspace, and the script writes references for a target layout that doesn't match. That currently leaves multi-target consumers with no supported integration path.Fix
React Native ≥ 0.75 ships an official mechanism for exactly this case:
spm_dependencydeclared in a library podspec, whichreact_native_post_installapplies to every target consuming the pod — oneXCRemoteSwiftPackageReferencein the Pods project, no pbxproj text manipulation, no per-target work.This PR declares FronteggSwift that way in
FronteggRN.podspec:defined?(spm_dependency)because autolinking evaluates the spec viapod ipc specin a subprocess wherereact_native_pods.rbisn't loaded — the install-time evaluation (the one that matters) has the helper.ios/frontegg_spm.rbremains the documented fallback — no behavior change for existing consumers.ios/Package.swift(1.3.11 at time of writing; comment notes to keep them in sync — you may prefer generating both from one source at release time).Validation
Validated on a production workspace with ~50 white-label app targets (RN 0.81.5, CocoaPods static linkage):
pod installinjects a single package reference (exactVersion), applied byreact_native_post_install— verified in the generatedPods.xcodeproj.Package.resolvedfor revision-exact supply-chain pinning, equivalent to Podfile.lock checksums.