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 /
  • Help Room /
avatar image
1
Question by ExtraFlash · May 30, 2017 at 12:13 AM · adsadmob

Admob rewarded video ads problem

I put rewarded video ads to my unity game and it works, i can see the video in my phone. The only problem is that i cant control the rewarded video events, I tried to do that when a player finishes to watch the video he will get more coins and also that the video ad button wont be activated:

 public void HandleRewardBasedVideoRewarded(object sender, Reward args)
     {
         videoButton.SetActive(false);
         valueScore += PlayerPrefs.GetInt("Currency");
         PlayerPrefs.SetInt("Currency", valueScore);
         alreadyShowedVideo = true;
         gotCoinsText.text = "You got more coins!";
     }

btw I also put the handlers in Start function

  void Start()
 {
 this.rewardBasedVideo = RewardBasedVideoAd.Instance;
         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;
 }
 

For some reason when i finish watching the video I dont get more coins and I can still see the video button.

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by wuym67123 · Jul 15, 2017 at 02:47 AM

Download those files from Admob Unity3d Plugin Project Home https://github.com/unity-plugins/Unity-Admob or Download all the Unity admob plugin project https://github.com/unity-plugins/Unity-Admob/archive/master.zip

Installation Admob Unity

Open your project in the Unity editor. Navigate to Assets -> Import Package -> Custom Package. Select the AdmobUnityPlugin.unitypackage file. Import all of the files for the plugins by selecting Import. Make sure to check for any conflicts with files

Init Admob Unity Plugin

Create A C# script ,drag the script to a object on scene , add the follow code in the script file

  using admob;
  Admob.Instance().initAdmob("admob banner id", "admob interstitial id");//admob id with format ca-app-pub-279xxxxxxxx/xxxxxxxx
  //Admob.Instance().initAdmob("ca-app-pub-3940256099942544/2934735716", "ca-app-pub-3940256099942544/4411468910");

Here is the minimal code to create an admob video.

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


video need to be explicitly shown at an appropriate stopping point in your app, check that the video is ready before showing it:

  if (Admob.Instance().isRewardedVideoReady()) {
    Admob.Instance().showRewardedVideo();
  }
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
avatar image
0

Answer by KingKong320 · Aug 28, 2018 at 11:07 AM

this.rewardBasedVideo.OnAdRewarded += this.HandleRewardBasedVideoRewarded; write this line right upper where you are showing ad.

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

107 People are following this question.

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

Related Questions

Admob Errors 1 Answer

Admob Banner Has Shown Only Twice in Two Weeks 0 Answers

Need help/guide on how to show AdMob interstitial ads 0 Answers

How to create a remove ads in app purchase for unity android game? 1 Answer

How to make an Ad Repeat after 5minutes iOS 0 Answers


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