admob reward video in unity is showing but does not call the HandleRewardBasedVideoRewarded

654 views
Skip to first unread message

ymz...@gmail.com

unread,
May 16, 2018, 2:55:35 PM5/16/18
to Google Mobile Ads SDK Developers
hi,

admob reward video in unity is showing but does not call the HandleRewardBasedVideoRewarded to add reward on IOS the videos are loading fine and it is working fine on android but on IOS it shows the video and when the user close it it does not add the reward for him

am using latest sdk

can anyone help?

mobileadssdk-a...@google.com

unread,
May 16, 2018, 3:38:27 PM5/16/18
to google-adm...@googlegroups.com, ymz...@gmail.com
Hi there,

Thank you for reaching out to us. Are you able to reproduce the issue with our Sample apps? Can you please share the complete device logs for us to look into the issue?

Regards,
Deepika Uragayala
Mobile Ads SDK Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-admob-ads-sdk/3df09977-5c9c-454b-b884-304cb8515834%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ymz...@gmail.com

unread,
May 16, 2018, 4:16:08 PM5/16/18
to Google Mobile Ads SDK Developers
i can share with you the code for handling admob videos, please check attached file.
AdmobController.cs

mobileadssdk-a...@google.com

unread,
May 17, 2018, 3:02:28 PM5/17/18
to ymz...@gmail.com, Google Mobile Ads SDK Developers
Hi there,

Thanks for sharing the code snippets and there's nothing out of ordinary with your code implementation  Can you send us the Ad Unit ID that you are using to load Reward Video Ads? And also Charles logs for us to debug this? It doesn't look like any issue with your integration. You can use "Reply privately to Author" option to share the requested information.

Regards,
Deepika Uragayala
Mobile Ads SDK Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

On 05/16/18 16:16:08 ymz...@gmail.com wrote:
i can share with you the code for handling admob videos, please check attached file.


On Wednesday, May 16, 2018 at 10:38:27 PM UTC+3, mobileadssdk-a...@google.com wrote:
Hi there,

Thank you for reaching out to us. Are you able to reproduce the issue with our Sample apps? Can you please share the complete device logs for us to look into the issue?

Regards,
Deepika Uragayala
Mobile Ads SDK Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

On 05/16/18 14:55:35 ymz...@gmail.com wrote:
hi,

admob reward video in unity is showing but does not call the HandleRewardBasedVideoRewarded to add reward on IOS the videos are loading fine and it is working fine on android but on IOS it shows the video and when the user close it it does not add the reward for him

am using latest sdk

can anyone help?

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsubscrib...@googlegroups.com.

--

---
You received this message because you are subscribed to the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-admob-ads-sdk+unsub...@googlegroups.com.
To post to this group, send email to google-admob-ads-sdk@googlegroups.com.

mobileadssdk-a...@google.com

unread,
May 18, 2018, 3:02:34 PM5/18/18
to ymz...@gmail.com, Google Mobile Ads SDK Developers
Hi there,

Thanks for sharing the requested information. I was able to load the Reward Video ad and the HandleRewardBasedVideoRewarded callback was being fired using the latest version of the Unity plugin with your Ad Unit ID without any issues. Can you confirm the plugin version that you are using and use the latest version and see if you are able to resolve the issue?

Regards,
Deepika Uragayala
Mobile Ads SDK Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

mobileadssdk-a...@google.com

unread,
May 21, 2018, 3:41:44 PM5/21/18
to ymz...@gmail.com, Google Mobile Ads SDK Developers
Hi there,

Can you include all of these callbacks and make sure to log them and send us another device logs for us to look into the issue? I'm curious whether OnAdOpening is being called along with the other callbacks. In your device logs, only OnAdLoaded is called and no OnAdOpening is present.

Regards,
Deepika Uragayala
Mobile Ads SDK Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

On 05/18/18 15:02:23 mobileadssdk-a...@google.com wrote:
Hi there,

Thanks for sharing the requested information. I was able to load the Reward Video ad and the HandleRewardBasedVideoRewarded callback was being fired using the latest version of the Unity plugin with your Ad Unit ID without any issues. Can you confirm the plugin version that you are using and use the latest version and see if you are able to resolve the issue?

Regards,
Deepika Uragayala
Mobile Ads SDK Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

YM Interactive

unread,
May 21, 2018, 4:21:20 PM5/21/18
to mobileadssdk-a...@google.com, Google Mobile Ads SDK Developers
hi, the OnAdOpening is included in the code but i guess it is not called.

using UnityEngine;
using System;
using GoogleMobileAds;
using GoogleMobileAds.Api;

public class AdmobController : MonoBehaviour
{
    private BannerView bannerView;
    public InterstitialAd interstitial;
    public RewardBasedVideoAd rewardBasedVideo;


    [Header("Interstitial")]
    public string androidInterstitial;
    public string iosInterstitial;

    [Header("Rewarded Video")]
    public string androidRewardedVideo;
    public string iosRewardedVideo;

    public static AdmobController instance;

    private void Awake()
    {
        instance = this;
    }

    private void Start()
    {
        //RequestBanner ();
        RequestInterstitial();

        InitRewardedVideo();
        RequestRewardBasedVideo();
        //ShowBanner ();
    }

    private void InitRewardedVideo()
    {
        // Get singleton reward based video ad reference.
        this.rewardBasedVideo = RewardBasedVideoAd.Instance;

        // RewardBasedVideoAd is a singleton, so handlers should only be registered once.
        this.rewardBasedVideo.OnAdLoaded += this.HandleRewardBasedVideoLoaded;
        this.rewardBasedVideo.OnAdFailedToLoad += this.HandleRewardBasedVideoFailedToLoad;
        this.rewardBasedVideo.OnAdOpening += this.HandleRewardBasedVideoOpened;
        this.rewardBasedVideo.OnAdStarted += this.HandleRewardBasedVideoStarted;
        this.rewardBasedVideo.OnAdRewarded += this.HandleRewardBasedVideoRewarded;
        this.rewardBasedVideo.OnAdClosed += this.HandleRewardBasedVideoClosed;
        this.rewardBasedVideo.OnAdLeavingApplication += this.HandleRewardBasedVideoLeftApplication;
    }

    public void RequestBanner()
    {
        // These ad units are configured to always serve test ads.
#if UNITY_EDITOR
        string adUnitId = "unused";
#elif UNITY_ANDROID
        string adUnitId = "";
#elif UNITY_IOS || UNITY_IPHONE
        string adUnitId = "";
#else
        string adUnitId = "unexpected_platform";
#endif

        // Create a 320x50 banner at the top of the screen.
        this.bannerView = new BannerView(adUnitId, AdSize.SmartBanner, AdPosition.Bottom);

        // Register for ad events.
        this.bannerView.OnAdLoaded += this.HandleAdLoaded;
        this.bannerView.OnAdFailedToLoad += this.HandleAdFailedToLoad;
        this.bannerView.OnAdOpening += this.HandleAdOpened;
        this.bannerView.OnAdClosed += this.HandleAdClosed;
        this.bannerView.OnAdLeavingApplication += this.HandleAdLeftApplication;

        // Load a banner ad.
        this.bannerView.LoadAd(this.CreateAdRequest());
    }

    public void RequestInterstitial()
    {
        // These ad units are configured to always serve test ads.
#if UNITY_EDITOR
        string adUnitId = "unused";
#elif UNITY_ANDROID
        string adUnitId = androidInterstitial.Trim();
#elif UNITY_IOS || UNITY_IPHONE
        string adUnitId = iosInterstitial.Trim();
#else
        string adUnitId = "unexpected_platform";
#endif

        // Create an interstitial.
        this.interstitial = new InterstitialAd(adUnitId);

        // Register for ad events.
        this.interstitial.OnAdLoaded += this.HandleInterstitialLoaded;
        this.interstitial.OnAdFailedToLoad += this.HandleInterstitialFailedToLoad;
        this.interstitial.OnAdOpening += this.HandleInterstitialOpened;
        this.interstitial.OnAdClosed += this.HandleInterstitialClosed;
        this.interstitial.OnAdLeavingApplication += this.HandleInterstitialLeftApplication;

        // Load an interstitial ad.
        this.interstitial.LoadAd(this.CreateAdRequest());
    }

    public void RequestRewardBasedVideo()
    {
#if UNITY_EDITOR
        string adUnitId = "unused";
#elif UNITY_ANDROID
        string adUnitId = androidRewardedVideo.Trim();
#elif UNITY_IOS || UNITY_IPHONE
        string adUnitId = iosRewardedVideo.Trim();
#else
        string adUnitId = "unexpected_platform";
#endif

        this.rewardBasedVideo.LoadAd(this.CreateAdRequest(), adUnitId);
    }

    // Returns an ad request with custom ad targeting.
    private AdRequest CreateAdRequest()
    {
        return new AdRequest.Builder()
                //.AddTestDevice(AdRequest.TestDeviceSimulator)
                //.AddTestDevice("0123456789ABCDEF0123456789ABCDEF")
                .Build();
    }

    public void ShowInterstitial(InterstitialAd ad)
    {
        if (ad != null && ad.IsLoaded())
        {
            ad.Show();
        }
    }

    public void ShowBanner()
    {
        // (CUtils.IsBuyItem()) return;
        if (bannerView != null)
        {
            bannerView.Show();
        }
        else
        {
            RequestBanner();
        }
    }

    public void HideBanner()
    {
        if (bannerView != null)
        {
            bannerView.Hide();
        }
    }

    public bool ShowInterstitial()
    {
        if (interstitial != null && interstitial.IsLoaded())
        {
            interstitial.Show();
            return true;
        }
        return false;
    }

    public void ShowRewardBasedVideo()
    {
        if (this.rewardBasedVideo.IsLoaded())
        {
            this.rewardBasedVideo.Show();
        }
        else
        {
            MonoBehaviour.print("Loading...");
        }
    }

    #region Banner callback handlers

    public void HandleAdLoaded(object sender, EventArgs args)
    {
        HideBanner();
        print("HandleAdLoaded event received.");
    }

    public void HandleAdFailedToLoad(object sender, AdFailedToLoadEventArgs args)
    {
        print("HandleFailedToReceiveAd event received with message: " + args.Message);
    }

    public void HandleAdOpened(object sender, EventArgs args)
    {
        print("HandleAdOpened event received");
    }

    public void HandleAdClosed(object sender, EventArgs args)
    {
        print("HandleAdClosed event received");
    }

    public void HandleAdLeftApplication(object sender, EventArgs args)
    {
        print("HandleAdLeftApplication event received");
    }

    #endregion

    #region Interstitial callback handlers

    public void HandleInterstitialLoaded(object sender, EventArgs args)
    {
        print("HandleInterstitialLoaded event received.");
    }

    public void HandleInterstitialFailedToLoad(object sender, AdFailedToLoadEventArgs args)
    {
        print("HandleInterstitialFailedToLoad event received with message: " + args.Message);
    }

    public void HandleInterstitialOpened(object sender, EventArgs args)
    {
        print("HandleInterstitialOpened event received");
    }

    public void HandleInterstitialClosed(object sender, EventArgs args)
    {
        print("HandleInterstitialClosed event received");
        RequestInterstitial();
    }

    public void HandleInterstitialLeftApplication(object sender, EventArgs args)
    {
        print("HandleInterstitialLeftApplication event received");
    }

    #endregion

    #region RewardBasedVideo callback handlers

    public void HandleRewardBasedVideoLoaded(object sender, EventArgs args)
    {
        MonoBehaviour.print("HandleRewardBasedVideoLoaded event received");
        Timer.Schedule(this, 2, RequestRewardBasedVideo);
    }

    public void HandleRewardBasedVideoFailedToLoad(object sender, AdFailedToLoadEventArgs args)
    {
        MonoBehaviour.print(
            "HandleRewardBasedVideoFailedToLoad event received with message: " + args.Message);
    }

    public void HandleRewardBasedVideoOpened(object sender, EventArgs args)
    {
        MonoBehaviour.print("HandleRewardBasedVideoOpened event received");
    }

    public void HandleRewardBasedVideoStarted(object sender, EventArgs args)
    {
        MonoBehaviour.print("HandleRewardBasedVideoStarted event received");
    }

    public void HandleRewardBasedVideoClosed(object sender, EventArgs args)
    {
        MonoBehaviour.print("HandleRewardBasedVideoClosed event received");
    }

    public void HandleRewardBasedVideoRewarded(object sender, Reward args)
    {
        string type = args.Type;
        double amount = args.Amount;
        MonoBehaviour.print(
            "HandleRewardBasedVideoRewarded event received for " + amount.ToString() + " " + type);
    }

    public void HandleRewardBasedVideoLeftApplication(object sender, EventArgs args)
    {
        MonoBehaviour.print("HandleRewardBasedVideoLeftApplication event received");
    }

    #endregion
}


On Mon, May 21, 2018 at 10:41 PM, <mobileadssdk-a...@google.com> wrote:
Hi there,

Can you include all of these callbacks and make sure to log them and send us another device logs for us to look into the issue? I'm curious whether OnAdOpening is being called along with the other callbacks. In your device logs, only OnAdLoaded is called and no OnAdOpening is present.

Regards,
Deepika Uragayala
Mobile Ads SDK Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

mobileadssdk-a...@google.com

unread,
May 22, 2018, 3:12:35 PM5/22/18
to YM Interactive, Google Mobile Ads SDK Developers
Hi there,

Thanks for sending the code snippets. I have made a sample app that includes an Xcode build for iOS and I would suggest that you try and let us know if you are still noticing this issue. I was able to load a Reward Video ad and notice that all of the callbacks are being fired as expected.

Regards,
Deepika Uragayala
Mobile Ads SDK Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Reset Four

unread,
Feb 8, 2019, 2:20:07 AM2/8/19
to Google Mobile Ads SDK Developers
Hi,

I have same problem. I want to show rewarded video If player is gameover. But admob rewarded video in unity 2018 3.4 is showing but not call the HandleRewardBasedVideoReward. On the other hand, If Open rewarded video with click button,rewarded video is showing and call the HandleRewardBaseVideoReward. I use same method for showing the rewarded video in gameover and button click. There is no different.

22 Mayıs 2018 Salı 22:12:35 UTC+3 tarihinde mobileadssdk-a...@google.com yazdı:

mobileadssdk...@google.com

unread,
Feb 8, 2019, 3:43:36 PM2/8/19
to Reset Four, Google Mobile Ads SDK Developers
Hello there,

Thanks for reaching out to us. Can you please share the complete device logs and a sample project with your implementation or code snippets for us to take a look? Are you seeing this with our latest version of unity plugin? Have your tried to reproduce this issue with our sample apps? You can share the details using "Reply Privately to Author". 

Regards,
Deepika Uragayala
Mobile Ads SDK Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Reset Four

unread,
Feb 11, 2019, 2:12:00 AM2/11/19
to Google Mobile Ads SDK Developers
Hi, 

I think that is problem when we not use button click to rewarded. Because When I use click the button for admob rewarded video, there is no problem and show rewarded video and call back HandleRewardBasedVideoReward. But When I call same method for admob rewarded video(NO Button Click),  show rewarded video NO call back HandleRewardBasedVideoReward.

I use this below Method For Show Rewarded Video both button click and direct call in game. 

    public void showRewardBased(){
        GetComponent<Admob_Manager>().ShowRewardBasedVideo();
    }



When I click the button, call rewarded base video, there is a sender. But I think that I call direclty the rewarded base video, there is no sender. So This video show but it can not call HandleRewardBasedVideoRewarded.


public void HandleRewardBasedVideoRewarded(object sender, Reward args)
    {......





8 Şubat 2019 Cuma 23:43:36 UTC+3 tarihinde mobileadssdk-forumadvisor yazdı:
Reply all
Reply to author
Forward
0 new messages