Hello!
Unity 5.5.0f3
I’m using GoogleAds Plugin, I’ve written code using tutorial form Firebase.
In Admob I set that I use ads from Unity Ads.
I think that I did it well, because I just took Game ID from my panel in Unity(it is number) and Placement ID: rewardedVideo.
Code compile without errors, but ads don’t show.
I couldn’t understand why, so I use Android Studio to get logs.
When I use test device logs are:
01-24 12:53:12.179 23581-23581/? I/Ads: Starting ad request.
01-24 12:53:12.889 17233-23711/? W/Ads: Received error HTTP response code: 403
01-24 12:53:12.899 23581-23593/? W/Ads: There was a problem getting an ad response. ErrorCode: 0
01-24 12:53:12.899 23581-23581/? W/Ads: Failed to load ad: 0
When I don’t use test device logs are:
01-24 13:02:01.789 26055-26055/? I/Ads: Starting ad request.
01-24 13:02:01.789 26055-26055/? I/Ads: Use AdRequest.Builder.addTestDevice("xxxxxxxxxxxxxxxxxxx") to get test ads on this device.
01-24 13:02:02.879 26055-26536/? W/Ads: Fail to instantiate adapter com.google.ads.mediation.unity.UnityAdapter
android.os.RemoteException
at com.google.android.gms.internal.zzjr.zzau(Unknown Source)
at com.google.android.gms.internal.zzjr.zzat(Unknown Source)
at com.google.android.gms.internal.zzjr.zzar(Unknown Source)
at com.google.android.gms.internal.zzjs$zza.onTransact(Unknown Source)
at android.os.Binder.transact(Binder.java:361)
at com.google.android.gms.ads.internal.mediation.client.d.a(:com.google.android.gms.DynamiteModulesA:94)
at com.google.android.gms.ads.internal.reward.c.b(:com.google.android.gms.DynamiteModulesA:220)
at com.google.android.gms.ads.internal.reward.mediation.j.a(:com.google.android.gms.DynamiteModulesA:1140)
at com.google.android.gms.ads.internal.util.b.run(:com.google.android.gms.DynamiteModulesA:19)
at com.google.android.gms.ads.internal.util.y.call(:com.google.android.gms.DynamiteModulesA:1055)
at com.google.android.gms.ads.internal.util.z.run(:com.google.android.gms.DynamiteModulesA:75)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
01-24 13:02:02.879 26055-26055/? W/Ads: Failed to load ad: 3
My functions are:
public void RequestRewardBasedVideo()
{
#if UNITY_EDITOR
string adUnitId = "unused";
#elif UNITY_ANDROID
string adUnitId = "ca-app-pub-xxxxxxxxxxxxxxxxxx/xxxxxxxx"; //I hidded ID ;)
#elif UNITY_IPHONE
string adUnitId = "unused";
#else
string adUnitId = "unexpected_platform";
#endif
RewardBasedVideoAd rewardBasedVideo = RewardBasedVideoAd.Instance;
AdRequest request = new AdRequest.Builder().AddTestDevice(AdRequest.TestDeviceSimulator) // Simulator.
.AddTestDevice("xxxxxxxxxxxxxxxxxxxxxxxxx").Build();
rewardBasedVideo.LoadAd(request, adUnitId);
showAdvertisment(rewardBasedVideo);
}
private void showAdvertisment(RewardBasedVideoAd rewardBasedVideo)
{
if (rewardBasedVideo.IsLoaded())
{
rewardBasedVideo.OnAdRewarded += HandleRewardBasedVideoRewarded;
rewardBasedVideo.Show();
}
}
public void HandleRewardBasedVideoRewarded(object sender, Reward args)
{
//reward
}
Could you help me?