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 Mansitos · Oct 18, 2017 at 05:33 PM · adsadmobgoogle

Google admob video shown only once for session

I Have another problem with ads, in my app can be shown 2 ads. 1 banner that is loaded when the app starts, which is always shown and works fine. There is another ad, which is a video ad shown to the player by clicking a "show add button for bonus life" after a "GAME OVER". It works only one time, after the first match, no ads are shown if the player try to get his bonus life after a game over... Any suggestions? I will paste the code:

Please consider the #android version only

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using admob;
 
 public class AdManager : MonoBehaviour {
 
     public static AdManager Instance{set;get;}
     public static int inizializzato = 0;
     public string bannerId;
     public string videoId;
     public static int bonuslife = 1;
 
     private void Start(){
 
         if (inizializzato == 0){
         Instance = this;
         DontDestroyOnLoad(gameObject);
         inizializzato = 1;
 
             #if UNITY_EDITOR
             #elif UNITY_ANDROID
             Admob.Instance ().initAdmob(bannerId,videoId);
             Admob.Instance ().setTesting(true);               //EDITOR MODE
             Admob.Instance ().loadInterstitial ();
             #endif
 
         }
         else
         {
             return;
         }
     }
 
     public void showBanner()
     {    
         #if UNITY_EDITOR
         Debug.Log ("BannerAd");
         #elif UNITY_ANDROID
         Admob.Instance ().showBannerRelative (AdSize.Banner, AdPosition.BOTTOM_CENTER, 0);
         #endif
     }
 
     public void showVideo()
     {
 
         //if(bonuslife == 1){
         #if UNITY_EDITOR
         Debug.Log ("VideoAd");
 
         if(bonuslife == 1){
         bonuslife = 0;
         Application.LoadLevel("PlayZone");
         }
         else{
         Application.LoadLevel("DefinitiveGameOver");
         }
         #elif UNITY_ANDROID
 
         if (Admob.Instance ().isInterstitialReady () && bonuslife == 1)
         {
             Admob.Instance ().showInterstitial ();
             Admob.Instance ().initAdmob(bannerId,videoId);
             Admob.Instance ().loadInterstitial ();
             bonuslife = 0;
             Application.LoadLevel("PlayZone");
         }
         else {
 
         if(bonuslife == 0){
         Application.LoadLevel("DefinitiveGameOver");
         }
         else{
         Application.LoadLevel("NoVideoGameOver");
         bonuslife = 0;
         }
         }
         #endif
         //}
     }
 }
 

OLD QUESTION - SOLVED BY DELETING ALL THE MANIFESTS AND CREATING A CUSTOM NEW ONE I'm just adding the ads in my game because I finished it. I was following this tutorial: https://www.youtube.com/watch?v=khlROw-PfNE because it's the first time that I use Google Admob, I followed the video but I have a lot of errors while building the game. So i google a lot and I decided to download the last version of the plugin from the site. But I dont know, it seems that all changed, for example "using AdMob now is replaced with "using GoogleMobileAds" I replaced that and now nothing works. The code seems completely wrong... Does anyone has an update tutorial? or can check my code? thanks

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
0

Answer by unity_G2yrNlWYdpJKuw · Oct 18, 2017 at 06:07 PM

I also used that video and it works completely fine... You are using googlemobile ads instead of admob. Check your code again...

Comment
Add comment · Show 2 · 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 Mansitos · Oct 18, 2017 at 07:03 PM 0
Share

Adding the plugin, without using it in any script gives me errors while building the apk

avatar image Mansitos · Oct 18, 2017 at 07:14 PM 0
Share

I removed the manifest.xml from the plugin folder and now it works, why? should it ruin something?

avatar image
0

Answer by Mansitos · Oct 20, 2017 at 11:40 AM

Up Any tips? :(

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

73 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

Related Questions

How do I enable AdMob to respond to inputs? 0 Answers

Admob Native Advanced Is not clickable 0 Answers

Stopped Google Ads Marketing for Apple Store game 0 Answers

The type or namespace name `GoogleMobileAds' could not be found. Are you missing a using directive or an assembly reference? 1 Answer

how do you set up the google mobile ads package to show ads 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