googleads / googleads-mobile-android-mediation

Sample Android project showcasing how to build a mediation adapter or custom event for the Google Mobile Ads SDK.
Apache License 2.0
245 stars 200 forks source link

Reward and close callbacks are not called with UnityAds when "don't keep activities" is on. #105

Closed noamfreeman closed 5 years ago

noamfreeman commented 6 years ago

Hi! I'm integrating unityAds with adMob mediation. When the developer option don't keep activities is off everything goes fine. The Unity testAd shows and the reward is called. In contrast, when the option is on, the ad shows, and we get all expected unity logs:

I/UnityAds: com.unity3d.services.core.api.Sdk.logInfo() (line:69) :: Unity Ads event: sending start event to https://impact.applifier.com/events/v2/video/video_start/....
I/UnityAds: com.unity3d.services.core.api.Sdk.logInfo() (line:69) :: Unity Ads event: sending first_quartile event to https://impact.applifier.com/events/v2/video/first_quartile/....
I/UnityAds: com.unity3d.services.core.api.Sdk.logInfo() (line:69) :: Unity Ads event: sending midpoint event to https://impact.applifier.com/events/v2/video/midpoint/....
I/UnityAds: com.unity3d.services.core.api.Sdk.logInfo() (line:69) :: Requesting ad plan from https://auction.unityads.unity3d.com/v4/games/....
I/UnityAds: com.unity3d.services.core.api.Sdk.logInfo() (line:69) :: Unity Ads event: sending third_quartile event to https://impact.applifier.com/events/v2/video/third_quartile/....
I/UnityAds: com.unity3d.services.core.api.Sdk.logInfo() (line:69) :: Unity Ads event: sending view event to https://impact.applifier.com/events/v2/video/video_end/....
I/UnityAds: com.unity3d.services.core.api.Sdk.logInfo() (line:69) :: AdPlan received with 1 campaigns and refreshDelay 0
I/UnityAds: com.unity3d.services.core.api.Sdk.logInfo() (line:69) :: Closing Unity Ads ad unit

but the adMob onRewardedVideoAdClosed() and onRewarded(RewardItem rewardItem) are never called.

In the same configuration, with the same adUnits, when the AdMob-mediation-service decides to serves an AdMob ad, everything works, so i think my configuration is fine.

i'm using:

    implementation "com.android.support:appcompat-v7:28.0.0"
    implementation "com.google.android.gms:play-services-ads:17.0.0"
    implementation "com.unity3d.ads:unity-ads:3.0.0"
    implementation "com.google.ads.mediation:unity:3.0.0.0"

The problem occurs in various API levels and devices (samsung, pixel, xiaomi, nexus, emulators). Upgrading to the last play-services-ads:17.1.1 does not help.

noamfreeman commented 6 years ago

Seems that if i don't call RewardedVideoAd.destroy() when the activity is destroyed, the problem does not show.

spilaka commented 5 years ago

@noamfreeman I tried to reproduce your issue. Tested on Nexus, everything works for me and I even called RewardedVideoAd.destroy() when activity is destroyed. Still I can see onRewardedVideoAdClosed() and onRewardedVideoAdClosed() are being called. I am not sure why it happened to you. Feel free to attach the sample project which reproduce the issue, so that we can debug more.

spilaka commented 5 years ago

@noamfreeman are you still facing the issue ?

noamfreeman commented 5 years ago

yes. but things are OK if we don't call the RewardedVideoAd.distroy()

On Tue, Jan 8, 2019 at 8:55 PM spilaka notifications@github.com wrote:

@noamfreeman https://github.com/noamfreeman are you still facing the issue ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/googleads/googleads-mobile-android-mediation/issues/105#issuecomment-452411311, or mute the thread https://github.com/notifications/unsubscribe-auth/AjiZ8OhxS1-zVVmcMbocFGPyCkLnXVuwks5vBOmbgaJpZM4YxwUo .

-- Noam Freeman

spilaka commented 5 years ago

Currently we are working on that issue. Next release will solve that issue. Thanks.

noamfreeman commented 5 years ago

thanks!

On Wed, Jan 16, 2019 at 8:40 PM spilaka notifications@github.com wrote:

Currently we are working on that issue. Next release will solve that issue. Thanks.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/googleads/googleads-mobile-android-mediation/issues/105#issuecomment-454891929, or mute the thread https://github.com/notifications/unsubscribe-auth/AjiZ8LDIKEa2rqvoXyOybhPPPByEt14wks5vD3IYgaJpZM4YxwUo .

-- Noam Freeman