feat(ump): add @react-native-ads/ump package for Google UMP consent - #6
Merged
Conversation
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.
Merged
2 tasks
Merged
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.
Summary
@react-native-ads/umpNitro-module package wrapping Google's User Messaging Platform SDK (GDPR/CCPA consent), following the same structure as the existingunity/pangle/liftoff/levelplaypackages.requestConsentInfoUpdate,loadAndShowConsentFormIfRequired,showPrivacyOptionsForm,showForm,gatherConsent,getConsentInfo,reset, plus IAB TCF helpers (getTCString,getGdprApplies,getPurposeConsents,getPurposeLegitimateInterests,getTCModel,getUserChoices) — matchingreact-native-google-mobile-ads'sAdsConsentsurface.@react-native-ads/umpinstead ofreact-native-google-mobile-adsfor consent gathering.ump.Test plan
yarn turbo run lint typecheck testpasses for@react-native-ads/umpand the whole monorepo (no regressions)nitrogencodegen runs cleanly for the new packagestatus: obtained,canRequestAds: true,showForm/showPrivacyOptionsForm/gatherConsent/getUserChoices/resetall exercised)WKWebViewand crashed (EXC_BREAKPOINT) when not invoked on the main thread —Promise.async'sTaskdoesn't guarantee resuming on the main thread after anawait. Fixed by moving every UMP SDK call into@MainActor-isolated functions; rebuilt and confirmed the real consent form renders with no crash.