Skip to content

fix: support Facebook SDK 18 and fix $FacebookSDKVersion override - #57

Merged
vgupta98 merged 3 commits into
masterfrom
fix/sdk-5068-support-facebook-sdk-18-and-fix-facebooksdkversion-override
Jul 6, 2026
Merged

fix: support Facebook SDK 18 and fix $FacebookSDKVersion override#57
vgupta98 merged 3 commits into
masterfrom
fix/sdk-5068-support-facebook-sdk-18-and-fix-facebooksdkversion-override

Conversation

@vgupta98

@vgupta98 vgupta98 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description

Updates the FBSDKCoreKit dependency handling in Rudder-Facebook.podspec to support Facebook SDK 18.x and to fix a crash in the $FacebookSDKVersion override path.

Previously the pod pinned the Facebook SDK to ~> 17.0.2, which only allows 17.0.x. Apps that use Facebook SDK 18.x could not install the pod because of a version conflict. Additionally, setting the $FacebookSDKVersion global in a Podfile crashed pod install due to a missing $ in a log statement.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactor/optimization

Implementation Details

  • Widened the default Facebook SDK version constraint from ~> 17.0.2 to ['>= 17.0.2', '< 19.0'], allowing all 17.x and 18.x releases.
  • Fixed the $FacebookSDKVersion override log line: it referenced #{FacebookSDKVersion} (missing the $), which Ruby resolved as the undefined constant Pod::FacebookSDKVersion and crashed pod install with uninitialized constant Pod::FacebookSDKVersion. Now uses #{$FacebookSDKVersion}.
  • Passed the version requirement to s.dependency via *Array(facebook_sdk_version), so both a user-supplied string override and the default multi-requirement array are forwarded correctly.

Checklist

  • I have added tests that prove my fix is effective or that my feature works.
  • I have added the necessary documentation (if appropriate).
  • I have ensured that my code follows the project's code style.
  • I have checked for potential performance impacts and optimized if necessary.
  • I have checked the code for security issues.
  • I have updated the changelog (if required).

How to test?

Verified locally against the Example app:

  1. Facebook SDK 18 resolvespod update FBSDKCoreKit installs FBSDKCoreKit 18.1.0 with the new range (previously blocked at 17.0.x).
  2. Override no longer crashes — set $FacebookSDKVersion = '~> 17.0' in the Podfile and run pod install; it prints Using user specified Facebook SDK version and installs successfully. On the previous podspec the same step crashed with uninitialized constant Pod::FacebookSDKVersion.
  3. Builds against FBSDK 18xcodebuild of the Rudder-Facebook-Example scheme against FBSDKCoreKit 18.1.0 completes with BUILD SUCCEEDED; the integration only uses stable App Events APIs unchanged in 18.

Breaking Changes

None. The change only widens the allowed dependency range and fixes the override path; existing installs on 17.x are unaffected.

Maintainers Checklist

  • The code has been reviewed.
  • CI tests have passed.
  • All necessary documentation has been updated.

Screenshots (if applicable)

N/A

Additional Context

Reference implementation: original external contribution in #56. Tracked under Linear SDK-5068.

- widen default FBSDKCoreKit constraint from `~> 17.0.2` to `>= 17.0.2, < 19.0` to allow Facebook SDK 18.x
- fix `$FacebookSDKVersion` override crashing pod install (missing `$` referenced undefined constant Pod::FacebookSDKVersion)
- splat the version via `*Array(...)` so both string overrides and the default range are passed to s.dependency

Scanned-by: gitleaks 8.29.0
@vgupta98
vgupta98 requested a review from a team as a code owner July 2, 2026 11:11
@vgupta98 vgupta98 assigned vgupta98 and unassigned vgupta98 Jul 2, 2026

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 updates the CocoaPods spec for the Rudder Facebook integration to allow installation alongside newer Facebook SDK releases (18.x) and fixes a pod install crash when users override the Facebook SDK version via $FacebookSDKVersion in their Podfile.

Changes:

  • Widened the default FBSDKCoreKit version constraints to allow Facebook SDK 17.x and 18.x (>= 17.0.2, < 19.0).
  • Fixed the $FacebookSDKVersion override log interpolation so it doesn’t reference an undefined constant.
  • Updated dependency declaration to forward either a string override or an array of requirements correctly (*Array(facebook_sdk_version)).

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

Comment thread Rudder-Facebook.podspec Outdated
Join the version requirement array so the install log prints
`>= 17.0.2, < 19.0` instead of the raw Ruby array literal.

Scanned-by: gitleaks 8.29.0
Comment thread Rudder-Facebook.podspec
Guard the override on a non-empty value so a nil/blank
$FacebookSDKVersion (e.g. from a missing env var) falls back to the
default `>= 17.0.2, < 19.0` range instead of dropping the version cap.

Scanned-by: gitleaks 8.29.0
@vgupta98
vgupta98 requested a review from dciccale July 3, 2026 06:10

@dciccale dciccale left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed the latest changes. The nil/empty $FacebookSDKVersion fallback is addressed, and validation is green.

@vgupta98
vgupta98 merged commit 50d50f0 into master Jul 6, 2026
11 checks passed
@vgupta98
vgupta98 deleted the fix/sdk-5068-support-facebook-sdk-18-and-fix-facebooksdkversion-override branch July 6, 2026 11:40
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.

3 participants