AdMob: show-time placement override persists after the ad is loaded again
Maintainers usually reply within 1 day
A pull request for this has already been merged.
- #2105 by @RaphaelFakhri — merged
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- react-native, typescript
- Domain
- mobile
Research direction
Start in the react-native-purchases-admob JavaScript layer and trace where TrackedAdState.showPlacement is set in prepareShow and where a new ad load is handled. Check the existing tests for reloading and showing an InterstitialAd or AppOpenAd; done means a show-time placement affects only that impression, and a subsequent show without an override uses the load-time placement for impression, click, and revenue events.
Written by the indexing model from the issue text.
Description
Describe the bug
In react-native-purchases-admob, the placement passed to RevenueCatAdMob.showAndTrack (or showWithRewardVerification) is stored on the ad's tracking state and never cleared. The README describes it as overriding the load-time placement "for this impression", but when the same InterstitialAd or AppOpenAd is loaded again and shown without a show-time placement, the next impression, click and revenue events still report the old override instead of the load-time placement.
Reloading the same ad object after CLOSED is the usual pattern with react-native-google-mobile-ads, so ad events end up attributed to the wrong placement.
-
Environment
- Platform: iOS and Android (JS layer)
- SDK version: react-native-purchases-admob 11.0.0
- React Native version: any
-
Steps to reproduce
const ad = RevenueCatAdMob.createInterstitialAd(unitId, { placement: "home" });
ad.load();
// after LOADED
await RevenueCatAdMob.showAndTrack(ad, { placement: "home_retry" });
// after CLOSED
ad.load();
// after LOADED
await RevenueCatAdMob.showAndTrack(ad);
- Expected: the second impression is tracked with
placement: "home". - Actual: the second impression is tracked with
placement: "home_retry".
- Other information
TrackedAdState.showPlacement is set in prepareShow and only read afterwards. Clearing it when a new ad is loaded keeps the override scoped to one impression.
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 124
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 69
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from RevenueCat/react-native-purchases
-
`entitlementVerificationMode` defaults to `DISABLED` and overrides the native default (`INFORMATIONAL`)Possibly taken @AlvaroBrey claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
RevenueCat/react-native-purchases#2127 ·
Maintainers usually reply within 1 day
-
TypeScript helpers (`__awaiter`, `__generator`, `__createBinding`, …) are inlined in every file of `dist`Possibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
RevenueCat/react-native-purchases#2079 · 1 comment ·
Maintainers usually reply within 1 day
-
presentCustomerCenter throws in preview API mode when callbacks are passedPossibly taken @RaphaelFakhri claimed this 20 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
RevenueCat/react-native-purchases#2050 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
RevenueCat/react-native-purchases#1912 ·
Maintainers usually reply within 1 day
-
presentCustomerCenter never resolves when it can't presentPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 3/5 1-2 days Newbie friendliness 42/100
RevenueCat/react-native-purchases#2098 · 1 comment ·
Maintainers usually reply within 1 day
All issues in RevenueCat/react-native-purchases
Similar issues
-
Bug: Cloudflare Pages static _redirects identity rule causes RSC Flight to reload as HTMLPossibly taken @Donvero claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Mantitup-Org/vista#210 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
simstudioai/sim#9831 ·
Maintainers usually reply within 1 day
-
status: waiting for maintainer
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
mui/material-ui#49751 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
diplodoc-platform/transform#1184 ·
Maintainers usually reply within 1 day