Skip to content

Fix rewarded end card close button staying hidden when reward already granted - #1005

Open
mdanylov-sigma wants to merge 1 commit into
masterfrom
claude/prebid-mobile-android-1004-588d57
Open

mdanylov-sigma wants to merge 1 commit into
masterfrom
claude/prebid-mobile-android-1004-588d57

Conversation

@mdanylov-sigma

Copy link
Copy Markdown
Collaborator

Summary

Fixes #1004.

AdInterstitialDialog.setUpCloseButtonTask() returned early when RewardManager.getUserRewardedAlready() was already true, without ever scheduling the close button to appear (it defaults to View.GONE).

For a VAST rewarded ad with an end card:

  1. The reward is granted during the video phase.
  2. The end card is then displayed via AdInterstitialDialog.
  3. setUpCloseButtonTask() hit the early return, so the close button was never scheduled — it stayed GONE for the lifetime of the end card, with no way to close the ad other than backgrounding/killing the app.

Fix

When the user is already rewarded on entry, the close button is now explicitly scheduled via scheduleCloseButtonDisplaying(), honoring the close.action/close.postrewardtime rules, instead of returning without any UI update.

Testing

  • Updated setUpCloseButton_userAlreadyRewarded in AdInterstitialDialogTest to assert the close button is scheduled (respecting postRewardTime/autoClose) instead of asserting nothing happens.
  • Ran ./gradlew :PrebidMobile-core:testDebugUnitTest --tests "org.prebid.mobile.rendering.interstitial.*" — all suites pass.

🤖 Generated with Claude Code

… granted

AdInterstitialDialog.setUpCloseButtonTask() returned early when
RewardManager.getUserRewardedAlready() was already true, without ever
scheduling the close button to appear. For a VAST rewarded ad with an
end card where the reward is granted during video playback, the end
card's close button (default View.GONE) then never became visible,
leaving the user stuck with no way to close the ad except
backgrounding/killing the app.

Now, when the user is already rewarded on entry, the close button is
explicitly scheduled via scheduleCloseButtonDisplaying(), honoring the
close.action/postrewardtime rules instead of just returning.

Fixes #1004

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

Rewarded end card close button can stay hidden forever if reward already granted before end card is shown

1 participant