Skip to content

feat(analytics): add Expo config plugin for withoutAdIdSupport#8969

Merged
mikehardy merged 4 commits intoinvertase:mainfrom
safaiyeh:feat/analytics-expo-no-ad-id
Apr 15, 2026
Merged

feat(analytics): add Expo config plugin for withoutAdIdSupport#8969
mikehardy merged 4 commits intoinvertase:mainfrom
safaiyeh:feat/analytics-expo-no-ad-id

Conversation

@safaiyeh
Copy link
Copy Markdown
Contributor

@safaiyeh safaiyeh commented Apr 11, 2026

Description

This adds an Expo config plugin for @react-native-firebase/analytics so Expo and EAS users can declaratively opt out of iOS Ad ID support.

Today the native CocoaPods integration already supports $RNFirebaseAnalyticsWithoutAdIdSupport = true, but Expo users do not have a package-level config plugin for Analytics that can write that Podfile variable during prebuild.

This PR adds that missing Expo surface by:

  • adding @react-native-firebase/analytics/app.plugin.js
  • adding an Analytics Expo plugin with ios.withoutAdIdSupport
  • updating the generated iOS Podfile when withoutAdIdSupport is enabled
  • documenting the Expo / EAS usage in the Analytics README and Expo installation docs
  • adding Jest coverage for add, idempotency, and removal behavior

Related issues

Release Summary

  • feat(analytics): add Expo config plugin support for ios.withoutAdIdSupport

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
    • Other (macOS, web)
  • My change includes tests;
    • e2e tests added or updated in packages/**/e2e
    • jest tests added or updated in packages/**/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan

  • ./node_modules/.bin/tsc --build packages/analytics/plugin
  • ./node_modules/.bin/eslint packages/analytics/plugin/src packages/analytics/plugin/__tests__
  • yarn tests:jest packages/analytics/plugin/__tests__/iosPlugin.test.ts

🔥


Note

Medium Risk
Adds a new Expo config plugin that mutates the generated iOS Podfile for Analytics; risk is mainly around iOS prebuild/pods generation for Expo/EAS users if the merge/remove logic or anchor matching behaves unexpectedly.

Overview
Enables Expo/EAS users of @react-native-firebase/analytics to declaratively disable iOS Ad ID support via a new config plugin option ios.withoutAdIdSupport.

Adds an app.plugin.js entrypoint and a TypeScript Expo config plugin that injects (and can remove, idempotently) $RNFirebaseAnalyticsWithoutAdIdSupport = true into the generated iOS Podfile during prebuild. Documentation is updated to show the new Expo configuration, and Jest coverage is added for the Podfile patching behavior.

Updates @react-native-firebase/analytics packaging to build/export the plugin (prepare runs build:plugin), and adds optional expo peer dependency plus related dev deps/lockfile updates.

Reviewed by Cursor Bugbot for commit fcc8107. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 11, 2026

@safaiyeh is attempting to deploy a commit to the Invertase Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces an Expo Config Plugin for @react-native-firebase/analytics, enabling users to opt out of iOS Ad ID support via the withoutAdIdSupport configuration option. The implementation includes documentation, build scripts, and logic to modify the iOS Podfile. Feedback suggests refining the linting glob pattern for better coverage, using relative paths for internal package references to ensure monorepo compatibility, and removing a redundant manual check in the Podfile modification logic.

Comment thread packages/analytics/package.json Outdated
Comment thread packages/analytics/plugin/src/index.ts Outdated
Comment thread packages/analytics/plugin/src/ios/podfile.ts Outdated
safaiyeh and others added 2 commits April 10, 2026 20:54
Use relative path for package.json require and remove redundant
FLAG idempotency check (mergeContents already handles it via TAG).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@safaiyeh safaiyeh marked this pull request as ready for review April 11, 2026 03:55
Comment thread packages/analytics/plugin/src/ios/podfile.ts Outdated
Expo passes undefined for props when the plugin is listed as a plain
string without a config object. Add optional chaining on props.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@safaiyeh
Copy link
Copy Markdown
Contributor Author

@BugBot run

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit fcc8107. Configure here.

Copy link
Copy Markdown
Collaborator

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

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

looks reasonable as a feature addition and well-done as code+tests, thanks!

we test iOS e2e in debug and release and they're always a bit flaky, one passed, and I'm sure the plugin code isn't going to affect only one variant so this is good to go w.r.t. CI

@mikehardy mikehardy merged commit 483c143 into invertase:main Apr 15, 2026
20 of 22 checks passed
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