Skip to content

feat(ump): add @react-native-ads/ump package for Google UMP consent - #6

Merged
exzos28 merged 5 commits into
mainfrom
feat/ump-package
Sep 4, 2026
Merged

feat(ump): add @react-native-ads/ump package for Google UMP consent#6
exzos28 merged 5 commits into
mainfrom
feat/ump-package

Conversation

@exzos28

@exzos28 exzos28 commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • New @react-native-ads/ump Nitro-module package wrapping Google's User Messaging Platform SDK (GDPR/CCPA consent), following the same structure as the existing unity/pangle/liftoff/levelplay packages.
  • Public API: requestConsentInfoUpdate, loadAndShowConsentFormIfRequired, showPrivacyOptionsForm, showForm, gatherConsent, getConsentInfo, reset, plus IAB TCF helpers (getTCString, getGdprApplies, getPurposeConsents, getPurposeLegitimateInterests, getTCModel, getUserChoices) — matching react-native-google-mobile-ads's AdsConsent surface.
  • The other four packages' READMEs now point to @react-native-ads/ump instead of react-native-google-mobile-ads for consent gathering.
  • CI's changed-packages matrix now includes ump.

Test plan

  • yarn turbo run lint typecheck test passes for @react-native-ads/ump and the whole monorepo (no regressions)
  • nitrogen codegen runs cleanly for the new package
  • Android example built and run on an emulator: full consent flow verified live (Google's Publisher Test Ads form shown, status: obtained, canRequestAds: true, showForm/showPrivacyOptionsForm/gatherConsent/getUserChoices/reset all exercised)
  • iOS example built with a real Xcode + CocoaPods toolchain and run on an iOS Simulator. First run caught a genuine bug: the UMP SDK's form-loading/presenting calls create a WKWebView and crashed (EXC_BREAKPOINT) when not invoked on the main thread — Promise.async's Task doesn't guarantee resuming on the main thread after an await. Fixed by moving every UMP SDK call into @MainActor-isolated functions; rebuilt and confirmed the real consent form renders with no crash.

New Nitro-module package wrapping Google's User Messaging Platform
SDK (GDPR/CCPA consent), matching the structure of the existing four
ad-network packages:

- requestConsentInfoUpdate, loadAndShowConsentFormIfRequired,
  showPrivacyOptionsForm, showForm, gatherConsent, getConsentInfo,
  reset
- getTCString/getGdprApplies/getPurposeConsents/
  getPurposeLegitimateInterests read the standard IABTCF_* keys the
  SDK writes to UserDefaults/SharedPreferences
- getTCModel/getUserChoices decode the TCF string via @iabtcf/core
  into a friendly view of the 10 purposes + 2 special features,
  mirroring react-native-google-mobile-ads' AdsConsent API

Also:
- wires packages/ump into CI's changed-packages matrix
- points the other four packages' READMEs at @react-native-ads/ump
  instead of react-native-google-mobile-ads for consent
- adds packages/ump/package.json's own hoistingLimits so the
  package's real npm dependencies (@babel/runtime, @iabtcf/core)
  resolve correctly for its isolated example app
Verified with a real Xcode build + iOS Simulator run: the app crashed
(EXC_BREAKPOINT in WKWebView init, off the main thread) because
`Promise.async`'s Task doesn't guarantee it resumes on the main
thread after `await currentViewController()`, and the UMP SDK creates
a WKWebView internally when loading/presenting a form — that must
happen on the main thread.

Move every UMP SDK call (requestConsentInfoUpdate,
loadAndPresentIfRequired, presentPrivacyOptionsForm, ConsentForm.load
+ present, reset) into @MainActor-isolated functions instead of
relying on execution context left over from an unrelated await.
@exzos28
exzos28 merged commit 0466020 into main Sep 4, 2026
@github-actions github-actions Bot mentioned this pull request Sep 4, 2026
@github-actions github-actions Bot mentioned this pull request Sep 4, 2026
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.

1 participant