I have been trying my best to get the Admob Rewarded Video to work/show in my app, but I just can't get it to work. I have all the plugins installed correctly I believe.
This is my current code.
using UnityEngine;
using System.Collections;
using GoogleMobileAds.Api;
public class AdManager2 : MonoBehaviour
{
string adUnitId = "MY_UNIT_ID";
RewardBasedVideoAd rewardBasedVideo = null;
void Start()
{
rewardBasedVideo = RewardBasedVideoAd.Instance;
}
public void adButton()
{
AdRequest request = new AdRequest.Builder().Build();
rewardBasedVideo.LoadAd(request, adUnitId);
showAd();
}
public void showAd()
{
if (rewardBasedVideo.IsLoaded())
{
rewardBasedVideo.Show();
}
}
}
This doesn't work for me, I click the button but nothing works. I have also tried multiple scripts from different people too, but not a single one of them work for me...
I would really appreciate it if someone could help me with this, Thanks in advance,
-Lente
As of March 2017 you no longer need to set up 3rd party mediation to use Admob rewarded video, since Admob have started serving their own reward ads. In fact if you are testing its better not to use 3rd party mediation at this stage because of the difficulty in generating test ads.
With 3rd party mediation you sign up to a 3rd party ad network, and you set a "test" flag of some sort in the 3rd party ad units on the 3rd party's site. You then link these units into your admob unit on the mediation tab and create an adrequest.
On March 16 2017 when I tested admob didn't serve rewarded videos to test ad requests contructed using builder.addTestDevice - sending back error code 0.
When admob weren't serving their own rewarded video ads this approach worked fine, but now that they are you will get back live admob ads along with test ads from your 3rd party provider(s). If you click on a live ad during testing you are breaking admob Ts and Cs.
(however in your case you aren't using a test adrequest anyway)
This post provides ad units for testing for IOS and Android, and I'd recommend using these.
If you are developing on android the best next step would be look at logcat and look for error responses from /ads