Require rewardVerificationResult callback#6762
Merged
Merged
Conversation
717f1c1 to
0d6aaf4
Compare
Enforce the rewarded-ad verification contract by making rewardVerificationResult mandatory in the AdMob verification present APIs while keeping rewardVerificationStarted optional. This aligns with platform-level AdMob reward handler requirements and prevents flows that start verification without consuming the resolved outcome.
0d6aaf4 to
3e49ceb
Compare
Update the rewarded verification API surface assertions to expect an escaping result callback, matching the tightened present signatures and preventing CI compile failures in RevenueCatAdMobTests.
ajpallares
approved these changes
May 12, 2026
ajpallares
left a comment
Member
There was a problem hiding this comment.
Great catch! I think this makes sense
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.
Checklist
purchases-androidand hybridsMotivation
This change tightens the AdMob reward-verification API contract so integrations handle the resolved verification outcome by default, not only verification start. It improves correctness, aligns with stricter cross-platform direction, and matches AdMob rewarded-ad semantics where presentation requires a reward handler (
OnUserEarnedRewardListeneron Android /userDidEarnRewardHandleron iOS).Description
Why
{ _ in }).What changed
RewardedAds+RewardVerification:rewardVerificationStartedremains optional.rewardVerificationResultis now required (non-optional, no default) for:GoogleMobileAds.RewardedAd.present(...)(with and withoutplacement)GoogleMobileAds.RewardedInterstitialAd.present(...)(with and withoutplacement)createUserDidEarnRewardHandler(...)now requiresrewardVerificationResult.warn + assertand.failed) and existing dispatch semantics.APISurfaceTeststo reflect required callback signatures.PresentRewardVerificationTests.rewardVerificationStarted.Migration impact
Before:
After:
Note
Medium Risk
Breaking API change to rewarded-ad
presentmethods: callers must now provide arewardVerificationResulthandler, which could require downstream migration and affects runtime behavior if omitted previously.Overview
Tightens the reward-verification API contract for AdMob rewarded ads by making
rewardVerificationResulta required, non-optional callback forRewardedAdandRewardedInterstitialAdpresent(...)(with and withoutplacement).Internally,
createUserDidEarnRewardHandler(...)now always expects a result handler, removes the nil-guard path, and consistently reports.failedwhen reward verification state is missing (while still warning/asserting). Tests are updated to reflect the new required callback signatures and remove the “nil result callback” scenario.Reviewed by Cursor Bugbot for commit 966b963. Bugbot is set up for automated code reviews on this repo. Configure here.