Skip to content

Add reward verification support to AdMobIntegrationSample example app#6746

Merged
polmiro merged 40 commits into
mainfrom
admob-reward-verification-sample-parity
May 11, 2026
Merged

Add reward verification support to AdMobIntegrationSample example app#6746
polmiro merged 40 commits into
mainfrom
admob-reward-verification-sample-parity

Conversation

@polmiro
Copy link
Copy Markdown
Member

@polmiro polmiro commented May 7, 2026

Checklist

  • If applicable, unit tests
  • If applicable, create follow-up issues for purchases-android and hybrids

Motivation

Add explicit Reward Verification support to the AdMob integration example app so developers can try both rewarded flows (with and without verification) from a clear, production-like sample UX.

Description

  • Adds Reward Verification support to rewarded and rewarded interstitial flows in AdMobIntegrationSample.
  • Refactors the sample interaction model to use a Reward Verification toggle with a single Load and Show flow per rewarded format.
  • Improves rewarded result UX with clearer state transitions (loading, ready, waiting, granted, verification outcomes, and mode-change reset behavior).
  • Renames sample/docs wording from "SSV" to "Reward Verification" for consistency with the RevenueCat feature name.
  • Updates adapter and sample README examples to document realistic Reward Verification outcome handling.

Sample architecture cleanup

While iterating on the rewarded flow the example app was reorganized to keep each ad format easy to read and copy:

  • One ad manager per format under Sources/AdManagers/, with separate verified and non-verified rewarded managers and an explicit isWaitingForReward flag tracking dismiss vs. reward outcome.
  • One detail view per format under Sources/DetailViews/, with HomeView reduced to a list and a per-format router.
  • Shared status copy lives in Sources/Support/Messages.swift; reusable view components (StatusAndButtons, RewardedControls, ResultCard, BannerAdView, NativeAdViewRepresentable, RootViewController) live under Sources/Components/ and Sources/Support/.
  • Manager status modeled as an optional message: String? so views render through ResultCard only when there is something to report; reward outcomes persist after the ad is dismissed instead of flashing back to a "Not Loaded" placeholder.
  • Format list reordered so Banner and App Open appear before Interstitial.

Screenshots

Copies and design might be slightly outdated.


Rewarded ad with reward verification
Screenshot 2026-05-07 at 19 41 05


Rewarded interstitial ad with reward verification
Screenshot 2026-05-07 at 19 43 20


Rewarded ad with failed reward verification: simulated using ad unit configured without SSV in AdMob Dashboard
Screenshot 2026-05-08 at 10 36 11


Note

Medium Risk
Touches multiple ad-format integration paths and presentation state handling in the sample app, including new reward verification presentation callbacks, which could change event tracking behavior if miswired. Changes are isolated to sample/demo code and documentation, limiting production impact.

Overview
Adds Reward Verification support to the AdMob integration sample for both rewarded formats, including a UI toggle to load/show ads with or without verification and richer result/status reporting.

Refactors the sample from a single AdMobManager into per-format *AdManager classes plus per-format detail views and shared UI components (ResultCard, StatusAndButtons, RewardedControls), and moves ad unit IDs out of Constants into each manager.

Updates the sample and adapter READMEs to document the verification-enabled flow (enableRewardVerification() + present(...rewardVerificationStarted:/rewardVerificationResult:)) and clarifies error-testing and test ID guidance.

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

@polmiro polmiro changed the title fix: improve rewarded sample reward verification UX feat: add reward verification support to AdMob integration sample May 7, 2026
@polmiro polmiro changed the title feat: add reward verification support to AdMob integration sample Add reward verification support to AdMob integration sample May 7, 2026
@polmiro polmiro changed the title Add reward verification support to AdMob integration sample Add reward verification support to AdMobIntegrationSample example app May 7, 2026
@polmiro polmiro requested review from ajpallares and peterporfy May 7, 2026 16:05
@polmiro polmiro marked this pull request as ready for review May 7, 2026 16:05
@polmiro polmiro requested a review from a team as a code owner May 7, 2026 16:05
@polmiro polmiro force-pushed the admob-reward-verification-sample-parity branch from 828df58 to 940843e Compare May 7, 2026 16:29
Base automatically changed from admob-reward-verification-public-api to main May 8, 2026 09:43
polmiro added 8 commits May 8, 2026 11:45
Unify rewarded sample flows around a single load/show interaction with a reward verification toggle, and make result states clearer and more stable during loading and mode changes. Update adapter and sample docs to match the new reward verification behavior and terminology.
Invalidate in-flight rewarded and rewarded interstitial loads when mode changes so outdated completion handlers can’t overwrite current UI state or loaded mode. Also clear opposite result fields on successful load to keep the result card consistent with the active mode.
Simplify rewarded loading copy and keep reward verification states clearer by removing misleading interim dismissal messaging. Add animated ellipsis in pending result cards so loading and verification progress are more obvious.
Tighten rewarded result messaging for load and verification outcomes, remove the mode-change prompt, and improve multiline card readability with added line spacing.
Remove terminal periods from rewarded load-state messages for consistency, and keep verification-mode dismissal transitions aligned with ongoing backend polling.
Show a no-reward-earned warning when verification-mode ads are dismissed before reward callbacks, and improve result card rendering so multi-line verified outcomes are easier to scan while keeping reward values visually prominent.
@polmiro polmiro force-pushed the admob-reward-verification-sample-parity branch from 5427a40 to c04b268 Compare May 8, 2026 09:50
Copy link
Copy Markdown
Contributor

@peterporfy peterporfy left a comment

Choose a reason for hiding this comment

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

LGTM - just one comment regarding example simplification

polmiro added 6 commits May 8, 2026 12:09
Break the example app's monolithic AdMob manager into per-format managers to make each integration path easier to review and copy. Keep placement and ad-unit values colocated with each manager to favor local, example-first readability.
Group the example app's ad managers under `Sources/AdManagers` with a `Support` subfolder so format-specific integration code is easier to navigate. Update project and docs paths to match the new layout without changing behavior.
Use `message` naming for sample ad manager UI strings to better communicate that these are display messages rather than formal state enums. Update HomeView bindings and helper signatures to keep naming consistent.
Use separate managers for native and native video formats so each integration path is easier to read and copy. Reduce branching in native ad loading and delegate handling while keeping behavior unchanged.
Separate verified and non-verified rewarded paths into dedicated managers to make each integration flow easier to read and copy in the sample app. Simplify manager logic by removing mode-branching and request-id invalidation from these examples.
Rename the rewarded flow dismiss guard flag to shouldReportDismissedBeforeReward so its intent remains clear after verification starts.
Read API key, proxy URL, and all ad unit IDs from optional local build settings while preserving committed defaults in source so developers can test locally without creating tracked diffs.
@polmiro polmiro force-pushed the admob-reward-verification-sample-parity branch from 6d8dc0c to 2996b94 Compare May 8, 2026 14:38
@polmiro polmiro force-pushed the admob-reward-verification-sample-parity branch from b165908 to 5c5e325 Compare May 8, 2026 15:31
Move the AdMob integration sample to a typed Message model with explicit severity/loading metadata so card tinting and button state no longer depend on string or emoji parsing.
@polmiro
Copy link
Copy Markdown
Member Author

polmiro commented May 8, 2026

@RCGitBot please test

Reset the loaded rewarded and rewarded-interstitial ad references as soon as verification finishes so failed verification outcomes can't leave stale ads showable.
@polmiro polmiro enabled auto-merge (squash) May 8, 2026 17:01
Copy link
Copy Markdown
Contributor

@peterporfy peterporfy left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Comment thread AdapterSDKs/RevenueCatAdMob/README.md Outdated
Copy link
Copy Markdown
Member

@ajpallares ajpallares left a comment

Choose a reason for hiding this comment

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

I think it looks great! Good job! I have some comments though

Comment thread AdapterSDKs/RevenueCatAdMob/README.md Outdated
Comment thread AdapterSDKs/RevenueCatAdMob/README.md Outdated
polmiro added 5 commits May 11, 2026 11:49
Ensure SwiftUI updates canShow-driven button states by publishing the backing ad references used by the sample ad managers.
Use Message.isLoading directly for loading animation rendering and remove redundant string-based helper logic.
Split verification result fallback into explicit unsupported reward handling and a separate unhandled reward-type fallback message.
Use an explicit optional placement placeholder in reward verification present examples to avoid implying the override is required.
@polmiro polmiro requested a review from ajpallares May 11, 2026 10:09
Copy link
Copy Markdown
Member

@ajpallares ajpallares left a comment

Choose a reason for hiding this comment

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

Great job!

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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9aad5e6. Configure here.

@polmiro polmiro merged commit 9901469 into main May 11, 2026
28 of 41 checks passed
@polmiro polmiro deleted the admob-reward-verification-sample-parity branch May 11, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants