Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by WaxerPL · Jan 25, 2017 at 09:09 AM · ads

Admob Rewarded Video from UnityAds

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?

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image topitsky · Jan 26, 2017 at 08:36 AM 0
Share

I'm having the save problem with simple banner ads.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by google_play_service_dev · Jul 19, 2017 at 02:32 AM

I am using https://github.com/unity-plugins/Unity-Admob ,my code.

load video

    Admob.Instance().loadRewardedVideo("ca-app-pub-3940256099942544/1712485313");

Shown at game over , check that the video is ready before showing it:

    if (Admob.Instance().isRewardedVideoReady()) {
      Admob.Instance().showRewardedVideo();
    }

handle ad event

 Admob.Instance().videoEventHandler += onInterstitialEvent;
     void onInterstitialEvent(string eventName, string msg)
     {
     Debug.Log("handler onAdmobEvent---" + eventName + "   " + msg);
     if (eventName == AdmobEvent.onAdLoaded)
     {
         Admob.Instance().showRewardedVideo();
     }
     if(eventName==AdmobEvent.onAdFail){
     Debug.log(msg);
     }

 }
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Why can I see my mobclix ads (using Prime31 plug-in with Unity) with my iPad and iPod Touch (3rd gen) but not my 4th gen iPhone? 1 Answer

Load Leadbolt ad before exiting from Game Unity3d 0 Answers

Revmob Banner Ads not clickable 2 Answers

Chartboost 5.0 plugin ios intergration 1 Answer

putting ads on a facebook game? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges