Add an interstitial Arbiter/TPA demo: CloudX vs AdMob - #7
Conversation
CloudX and AdMob load in parallel for all four formats and CloudXSdk.Arbiter picks the platform to show. Interstitial and rewarded prepare the winner ahead of the placement; banner and MREC arbitrate and then render on a 25 s cycle with auto-refresh off on both sides and only the winner's view ever shown. AdMob paid events are forwarded through ReportRevenueData, as the docs require. The Options button routes to the new ArbiterScene. Google's AdMob test ad unit ids move from FirstLookConfig to DemoConfig so both demo folders share them.
There was a problem hiding this comment.
🟡 Changes recommended
Fullscreen reentrancy and inline hide/show races can disrupt ad presentation, while inline status results are missing from the UI.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a Trusted Arbiter demo where CloudX and AdMob load concurrently across four ad formats.
Changes:
- Adds fullscreen and inline arbitration controllers with AdMob revenue forwarding.
- Adds and routes the new Arbiter scene.
- Centralizes AdMob test IDs and documents the flow.
File summaries
| File | Description |
|---|---|
README.md |
Documents the Arbiter demo. |
ProjectSettings/EditorBuildSettings.asset |
Registers the Arbiter scene. |
Assets/Scripts/OptionsScreen.cs |
Routes the Arbiter button. |
Assets/Scripts/FirstLook/FirstLookScreen.cs |
Uses shared AdMob IDs. |
Assets/Scripts/FirstLook/FirstLookConfig.cs |
Removes duplicated IDs. |
Assets/Scripts/DemoConfig.cs |
Centralizes AdMob IDs. |
Assets/Scripts/Arbiter/ArbiterScreen.cs.meta |
Registers screen asset metadata. |
Assets/Scripts/Arbiter/ArbiterScreen.cs |
Initializes and coordinates the demo. |
Assets/Scripts/Arbiter/ArbiterRewardedController.cs.meta |
Registers rewarded metadata. |
Assets/Scripts/Arbiter/ArbiterRewardedController.cs |
Implements rewarded arbitration. |
Assets/Scripts/Arbiter/ArbiterMrecController.cs.meta |
Registers MREC metadata. |
Assets/Scripts/Arbiter/ArbiterMrecController.cs |
Implements MREC integration. |
Assets/Scripts/Arbiter/ArbiterInterstitialController.cs.meta |
Registers interstitial metadata. |
Assets/Scripts/Arbiter/ArbiterInterstitialController.cs |
Implements interstitial arbitration. |
Assets/Scripts/Arbiter/ArbiterInlineController.cs.meta |
Registers inline-base metadata. |
Assets/Scripts/Arbiter/ArbiterInlineController.cs |
Manages inline arbitration cycles. |
Assets/Scripts/Arbiter/ArbiterFullscreenController.cs.meta |
Registers fullscreen-base metadata. |
Assets/Scripts/Arbiter/ArbiterFullscreenController.cs |
Manages prepared fullscreen winners. |
Assets/Scripts/Arbiter/ArbiterConfig.cs.meta |
Registers configuration metadata. |
Assets/Scripts/Arbiter/ArbiterConfig.cs |
Defines demo switches and refresh timing. |
Assets/Scripts/Arbiter/ArbiterBannerController.cs.meta |
Registers banner metadata. |
Assets/Scripts/Arbiter/ArbiterBannerController.cs |
Implements banner integration. |
Assets/Scripts/Arbiter/ArbiterAdController.cs.meta |
Registers shared-base metadata. |
Assets/Scripts/Arbiter/ArbiterAdController.cs |
Provides arbitration and revenue plumbing. |
Assets/Scripts/Arbiter.meta |
Registers the Arbiter folder. |
Assets/Scenes/ArbiterScene.unity.meta |
Registers scene metadata. |
Assets/Scenes/ArbiterScene.unity |
Defines the Arbiter demo UI. |
Review details
Files not reviewed (11)
- Assets/Scenes/ArbiterScene.unity.meta: Generated file
- Assets/Scripts/Arbiter.meta: Generated file
- Assets/Scripts/Arbiter/ArbiterAdController.cs.meta: Generated file
- Assets/Scripts/Arbiter/ArbiterBannerController.cs.meta: Generated file
- Assets/Scripts/Arbiter/ArbiterConfig.cs.meta: Generated file
- Assets/Scripts/Arbiter/ArbiterFullscreenController.cs.meta: Generated file
- Assets/Scripts/Arbiter/ArbiterInlineController.cs.meta: Generated file
- Assets/Scripts/Arbiter/ArbiterInterstitialController.cs.meta: Generated file
- Assets/Scripts/Arbiter/ArbiterMrecController.cs.meta: Generated file
- Assets/Scripts/Arbiter/ArbiterRewardedController.cs.meta: Generated file
- Assets/Scripts/Arbiter/ArbiterScreen.cs.meta: Generated file
- Files reviewed: 16/30 changed files
- Comments generated: 4
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Fullscreen: track the show in progress so a second tap or a retry cannot reload or destroy the ad that is opening; the close or show-failure callback restarts the cycle. - Inline: when the interval elapses, hide the consumed winner before its reload (an in-place reload rendered a creative no round had selected) and re-request every network without a fill, not only the winner. A round invalidated by Hide() resumes arbitration if Show() was tapped again meanwhile. - Screen: banner and MREC labels carry the arbiter result and bid count, since those formats have no status line.
main squash-landed the First Look rework (two formats, the extracted pass cycle, and the removal of the internal ForceCloudXNoFill switch) while this branch moved the AdMob test ad unit ids into DemoConfig so both demos could share them. Three files conflicted and each one was the same question in a different place. FirstLookConfig.cs is deleted. Both sides emptied it from opposite ends: this branch took the AdMob ids out, main took ForceCloudXNoFill out, and what was left was an empty class. The ids stay in DemoConfig, which is what the Arbiter screen already reads and what carries AdMobMrecAdUnitId and AdMobRewardedAdUnitId that First Look no longer needs but Arbiter does. FirstLookScreen.cs takes main's version, then repoints its two AdMob references at DemoConfig. This branch's other two call sites drove the rewarded and MREC controllers, which main deleted along with the shared controller base, so there was nothing there to carry across. README.md keeps this branch's Arbiter clause in the intro and its note that the AdMob units live in DemoConfig, and takes main's First Look file table and banner paragraph. The row for the deleted FirstLookConfig.cs is dropped. Batchmode compile is clean, no missing script references, and all four scenes are still listed in the build settings.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Late CloudX initialization leaves AdMob paid-event forwarding permanently disabled for the session.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Resolved since last review (4)
The PR description and README promise an arbiter-result/bid-count status line for every format, but… The PR description and README say each format’s status line shows the arbiter result and bid count,… Hiding invalidates the in-flight result but leavesArbiterInFlightset. If the user taps Show… Clearing the winner here leaves no state indicating that its fullscreen ad is opening/showing. A…
Files not reviewed (4)
- Assets/Scenes/ArbiterScene.unity.meta: Generated file
- Assets/Scripts/Arbiter.meta: Generated file
- Assets/Scripts/Arbiter/ArbiterInterstitialController.cs.meta: Generated file
- Assets/Scripts/Arbiter/ArbiterScreen.cs.meta: Generated file
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation is internally consistent, fully wired into the demo, and no unresolved correctness issues were found.
Review effort: Balanced
Findings: None
Resolved since last review (1)
Files not reviewed (4)
- Assets/Scenes/ArbiterScene.unity.meta: Generated file
- Assets/Scripts/Arbiter.meta: Generated file
- Assets/Scripts/Arbiter/ArbiterInterstitialController.cs.meta: Generated file
- Assets/Scripts/Arbiter/ArbiterScreen.cs.meta: Generated file


Implements the public Unity Trusted Arbiter demo as one copyable interstitial integration, following the simpler public Flutter demo shape.
What changed
ArbiterInterstitialControllercontaining the CloudX flow, AdMob flow, arbitration, lifecycle guards, and required paid-event forwarding.ArbiterScreento initialize both SDKs, drive the interstitial controller, display arbitration and revenue status, and retry terminal failures with backoff.ArbiterConfigimplementations. The other three buttons are hidden without changing the scene.DemoConfig.The controller compiles as one file once the CloudX SDK and Google Mobile Ads Unity plugin are installed. Rewarded can follow the same structure with the rewarded SDK calls and reward event substituted. Banner and MREC need a separate refresh-cycle controller and remain a later phase.
Verified
6000.0.60f1batchmode compile completed with zero C# errors.accepted=True, closed, and completed a fresh arbitration.LOAD_NOT_ALLOWED_WHILE_SHOWING[303]after close.Known runtime log
The Google Mobile Ads Android plugin emitted a caught
FileNotFoundExceptionforGoogleMobileAdsNative.Commonafter the successful flow. AdMob initialization, load, show, paid-event forwarding, and reload all completed successfully.