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
0
Question by Tariq-mehmood · Mar 24, 2019 at 11:09 AM · adsadmobgoogle playunity ads

Admob and Unity ads not showing in my game

Hi Everyone.

I have published my game called bird killer with AdMob ads and using interstitials and rewarded video ads and after publishing, I came to know that my ads are not working my interstitials sometime show up but on maximum time do not show up and rewarded video is not showing even single time and rewarded video showing is important i my game because I have a life system and when life is finished you can get by watching rewarded videos but rewarded videos are not working.

now after 2 days of battling and still not working so, I used unity ads but they also don't show up i am stuck in it.

what I have done till now.

  1. I am using Google Mobile Ads Unity Plugin v3.16 and tried in v3.0.0 and many more.

  2. Added app id in android manifest.

  3. Unity Ads are on in unity.

  4. my code of ads manager is below

          using UnityEngine;
          using System.Collections;
          using GoogleMobileAds;
          using GoogleMobileAds.Api;
          using System;
          //using admob;
          using UnityEngine.Advertisements;
    
    
    
       public class AdsManager : MonoBehaviour
      {
    
    
     private InterstitialAd interstitial;
     private RewardedAd rewardedAd;
    
     //  Admob ad;
     string appId = "ca-app-pub-2931825634126153~1092346741";
     string InterstitialadUnitId = "ca-app-pub-2931825634126153/3845081715";
     public static bool Is_Live_Button;
     public static bool AdnotavailablePanal;
    
     
     // Use this for initialization
     void Awake()
     {
         
         Advertisement.Initialize("3091031");
          MobileAds.Initialize(appId);
    
         this.RequestRewardBasedVideo();
    
         AdnotavailablePanal = false;
         DontDestroyOnLoad(this.gameObject);
       
         RequestInterstitial();
         StartCoroutine(rewarededvideo());
         StartCoroutine(Interstial());
         StartCoroutine(Ini());
    
     }
    
    
    
     void Start()
     {
    
         ShowInterstital();
        
     }
    
    
     private void RequestRewardBasedVideo()
     {
         string RewardedadUnitId = "ca-app-pub-2931825634126153/5278293320";
    
         this.rewardedAd = new RewardedAd(RewardedadUnitId);
    
    
         // Create an empty ad request.
         AdRequest request = new AdRequest.Builder().Build();
         this.rewardedAd.LoadAd(request);
     }
    
    
    
     public void RequestInterstitial()
     {
    
    
         this.interstitial = new InterstitialAd(InterstitialadUnitId);
         AdRequest request = new AdRequest.Builder().Build();
         this.interstitial.LoadAd(request);
         this.interstitial.OnAdFailedToLoad += HandleOnAdFailedToLoad;
         this.interstitial.OnAdClosed += HandleOnAdClosed;
     }
    
    
     public void ShowInterstital()
     {
    
         if (this.interstitial.IsLoaded())
         {
             RequestInterstitial();
             this.interstitial.Show();
          
         }
         else
         {
             RequestInterstitial();
             StartCoroutine(Interstial());
         }
    
     
    
    
     }
    
     private void HandleOnAdClosed(object sender, EventArgs e)
     {
         RequestInterstitial();
     }
    
     private void HandleOnAdFailedToLoad(object sender, AdFailedToLoadEventArgs e)
     {
         RequestInterstitial();
     }
    
    
    
     public void ShowRewardedWatchAd()
     {
        if (Advertisement.IsReady("rewardedVideo"))
         {
             GiveRewardForGamePaly();
             Advertisement.Show("rewardedVideo");
    
         }
         else if (rewardedAd.IsLoaded())
         {
             rewardedAd.Show();
             GiveRewardForGamePaly();
    
         }
         else
         {
             //    AdnotavailablePanal.SetActive(true);
             AdnotavailablePanal = true;
             RequestRewardBasedVideo();
             StartCoroutine(rewarededvideo());
    
         }
    
     }
    
    
     public void ShowRewardedWatchAdForLive()
     {
         
      if (Advertisement.IsReady("rewardedVideo"))
         {
             Is_Live_Button = true;
             GiveRewardForMain();
             Advertisement.Show("rewardedVideo");
    
         }
         else if (rewardedAd.IsLoaded())
         {
             rewardedAd.Show();
             Is_Live_Button = true;
             GiveRewardForMain();
    
    
         }
         else
         {
             //   AdnotavailablePanal.SetActive(true);
             AdnotavailablePanal = true;
             RequestRewardBasedVideo();
             StartCoroutine(rewarededvideo());
         }
     }
    
    
     public void ShowRewardedWatchAdForCash()
     {
        if (Advertisement.IsReady("rewardedVideo"))
         {
             Advertisement.Show("rewardedVideo");
             GiveRewardForMain();
         }
         else if (rewardedAd.IsLoaded())
         {
             rewardedAd.Show();
             GiveRewardForMain();
    
    
         }
         else
         {
             //   AdnotavailablePanal.SetActive(true);
             AdnotavailablePanal = true;
             RequestRewardBasedVideo();
             StartCoroutine(rewarededvideo());
    
         }
     }
    
    
    
    
     public void GiveRewardForMain()
     {
    
         if (Is_Live_Button)
         {
             Debug.Log("Live");
             PlayerPrefs.SetInt("Live", PlayerPrefs.GetInt("Live") + 1);
             Is_Live_Button = false;
         }
         else
         {
             Debug.Log("Cash");
             PlayerPrefs.SetInt("cash", PlayerPrefs.GetInt("cash") + 500);
    
         }
    
     }
    
     public void GiveRewardForGamePaly()
     {
    
         Debug.Log("i am in");
         PlayerPrefs.SetInt("Live", PlayerPrefs.GetInt("Live") + 1);
         Application.LoadLevel("Loading");
    
    
    
     }
    
    
     public void RestartScene()
     {
         
         Application.LoadLevel("Loading");
    
     }
    
    
    
    
    
     
    
    
    
     IEnumerator rewarededvideo()
     {
         yield return new WaitForSeconds(0.1f);
         if (!rewardedAd.IsLoaded())
         {
             RequestRewardBasedVideo();
    
         }
         else
         {
             StartCoroutine(rewarededvideo());
    
         }
    
        
     }
    
    
     IEnumerator Interstial()
     {
         yield return new WaitForSeconds(0.1f);
         if (!this.interstitial.IsLoaded())
         {
             RequestInterstitial();
            
    
         }
    
         StartCoroutine(Interstial());
     }
    
    
    
     IEnumerator Ini()
     {
         yield return new WaitForSeconds(0.1f);
         if (!Advertisement.isInitialized)
         {
             Advertisement.Initialize("3091031");
           
    
         }
      
         StartCoroutine(Ini());
     }
    
    
    
    
    
     }
    
    
    
    

I am calling StartCoroutine(Ini()); because unity does not Initialize automatically. I am calling StartCoroutine(Interstial()); to make sure ads is ready to show every time. I am calling StartCoroutine(rewarededvideo()); to make sure rewarded video is ready to show every time. I am using Unity 5.3.6f1

I am stuck in this problem from days now any help can be much applicated. Thanks In advance.

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 yennefer4568 · Apr 06, 2019 at 12:47 PM

in my game app;

Admob Ads doesn't show when im using the real Ad Id, but using test AdId it show up

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 Senkrigar · Sep 18, 2019 at 04:36 PM

Hello, I'm having the same problem here, did you manage to make it work ?

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

174 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 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

Enable Unity Ads in Services 0 Answers

failed to repackage resource admob 0 Answers

How much money I can earn with Unity Ads? 1 Answer

Admob impressions are not counted 0 Answers

How can I show my own game custom rewarded ad in other games?,how can I show my own game ad in other game? 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