Skip to content

Add an interstitial Arbiter/TPA demo: CloudX vs AdMob - #7

Merged
antonurankar-moloco merged 7 commits into
mainfrom
tomi-arbiter-tpa-demo
Sep 21, 2026
Merged

antonurankar-moloco merged 7 commits into
mainfrom
tomi-arbiter-tpa-demo

Conversation

@antonurankar-moloco

@antonurankar-moloco antonurankar-moloco commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Implements the public Unity Trusted Arbiter demo as one copyable interstitial integration, following the simpler public Flutter demo shape.

What changed

  • Replaced the multi-format controller hierarchy with one flat, sealed ArbiterInterstitialController containing the CloudX flow, AdMob flow, arbitration, lifecycle guards, and required paid-event forwarding.
  • Simplified ArbiterScreen to initialize both SDKs, drive the interstitial controller, display arbitration and revenue status, and retry terminal failures with backoff.
  • Removed the rewarded, banner, MREC, shared base, and ArbiterConfig implementations. The other three buttons are hidden without changing the scene.
  • Removed unused AdMob rewarded and MREC ids from DemoConfig.
  • Reworked the README integration guidance and replaced the Arbiter screenshot.

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

  • Unity 6000.0.60f1 batchmode compile completed with zero C# errors.
  • Android export and debug APK build succeeded.
  • iOS simulator export and Xcode build succeeded.
  • Android and iOS each loaded CloudX and AdMob, submitted two bids, showed the stored winner, forwarded AdMob revenue with accepted=True, closed, and completed a fresh arbitration.
  • Neither platform produced LOAD_NOT_ALLOWED_WHILE_SHOWING[303] after close.
  • A temporary invalid Android app key exercised the degraded path: CloudX initialization failed, one AdMob bid was selected locally, and no uninitialized CloudX arbiter call was made.
  • Deleted controller GUIDs are not referenced by any scene, removed symbols have no remaining demo references, and all modified text files end with a newline.

Known runtime log

The Google Mobile Ads Android plugin emitted a caught FileNotFoundException for GoogleMobileAdsNative.Common after the successful flow. AdMob initialization, load, show, paid-event forwarding, and reload all completed successfully.

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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.

Comment thread Assets/Scripts/Arbiter/ArbiterFullscreenController.cs Outdated
Comment thread Assets/Scripts/Arbiter/ArbiterInlineController.cs Outdated
Comment thread Assets/Scripts/Arbiter/ArbiterScreen.cs Outdated
Comment thread Assets/Scripts/Arbiter/ArbiterScreen.cs Outdated
- 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.
@antonurankar-moloco antonurankar-moloco changed the title Add an Arbiter/TPA demo: CloudX vs AdMob through Trusted Arbiter Add an interstitial Arbiter/TPA demo: CloudX vs AdMob Sep 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 High severity

Open (1)
Resolved since last review (4)
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

Comment thread Assets/Scripts/Arbiter/ArbiterInterstitialController.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

@antonurankar-moloco
antonurankar-moloco merged commit 4f950b5 into main Sep 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants