Skip to content

<feat>(GH-3077):<Android>: UnityAds adapter context handling - #29

Closed
AnwarissaAsbah wants to merge 3 commits into
mainfrom
feat/gh-3077_context-handling
Closed

<feat>(GH-3077):<Android>: UnityAds adapter context handling#29
AnwarissaAsbah wants to merge 3 commits into
mainfrom
feat/gh-3077_context-handling

Conversation

@AnwarissaAsbah

Copy link
Copy Markdown

Remove context checks at load and show (for both IS and RV) time as it blocks ad loading and showing when context is not a valid activity.

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.

Pull request overview

This PR updates the Unity Ads mediation adapter’s interstitial and rewarded show-time context handling so non-Activity contexts no longer fail before calling Unity Ads.

Changes:

  • Passes null activity to Unity Ads show calls when the provided context is not an Activity.
  • Updates interstitial and rewarded tests to verify the new non-Activity behavior.
  • Removes an unused Unity adapter error message constant.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
ThirdPartyAdapters/unity/unity/src/main/java/com/google/ads/mediation/unity/UnityInterstitialAd.java Uses a nullable Activity when showing interstitial ads.
ThirdPartyAdapters/unity/unity/src/main/java/com/google/ads/mediation/unity/UnityRewardedAd.java Removes rewarded show-time non-Activity failure path and passes nullable activity to Unity Ads.
ThirdPartyAdapters/unity/unity/src/main/java/com/google/ads/mediation/unity/UnityMediationAdapter.java Removes unused context-null error message constant.
ThirdPartyAdapters/unity/unity/src/test/kotlin/com/google/ads/mediation/unity/UnityInterstitialAdTest.kt Adds coverage for showing with a non-Activity context.
ThirdPartyAdapters/unity/unity/src/test/kotlin/com/google/ads/mediation/unity/UnityRewardedAdTest.kt Updates non-Activity show behavior coverage for rewarded ads.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vishaldhiman-unity
vishaldhiman-unity requested a review from u-pr June 1, 2026 15:41
@AnwarissaAsbah

Copy link
Copy Markdown
Author

no more relavent

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