Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question AdMob sample AD works in Unity, but doesn't work on actual android device.

Discussion in 'Android' started by jarofed, Feb 13, 2023.

  1. jarofed

    jarofed

    Joined:
    Dec 5, 2020
    Posts:
    4
    My game implements rewarded ad. I'm using sample ad unit ID from admob. It works perfectly in Unity. But when I compliling aab file, upload it to google play console and enable internal testing - it just doesn't work. Ad doesn't show.

    Please, help me to figure out, how to fix this issue.
     
    anycolourulike likes this.
  2. PlurInteractive

    PlurInteractive

    Joined:
    Feb 3, 2020
    Posts:
    2
    I had the same issue. Still do actually. You can try asking the dev support team here: https://groups.google.com/g/google-admob-ads-sdk. They basically told me "Hurr, ads are working for us using your IDs on our application" not helpful at all. Seriously about to just give up and go to a in-app purchase model. I've literally spent the past two weeks trying to figure out admob. It's so bad.
     
    anycolourulike likes this.
  3. jarofed

    jarofed

    Joined:
    Dec 5, 2020
    Posts:
    4
    In fact I've not even tried my own IDs yet. What I'm using is AdMob sample IDs, that should work everywhere. And they work in editor like no problem. But when I install the app from google play to my device it doesn't work.

    Thank you for the link to admob support. Will try my luck there too.
     
  4. jarofed

    jarofed

    Joined:
    Dec 5, 2020
    Posts:
    4
    I've tested this issue further. And it looks like callback of MobileAds.Initialize(Callback) is never invoked on actual android device, while working as a charm in Unity editor.

    Here is my implementation:

    Code (CSharp):
    1. void Start()
    2. {
    3.         MobileAds.Initialize(AdsInitialized);
    4. }
    5.  
    6. private void AdsInitialized(InitializationStatus obj)
    7. {
    8.         //Code to load an actual ad here. But this method is is never invoked on android device
    9. }
    Any ideas why initialization is never completed?
     
    anycolourulike likes this.
  5. anycolourulike

    anycolourulike

    Joined:
    Oct 14, 2017
    Posts:
    5
    Same issue using test device and actual ad and app ids
     
    mike_repenko likes this.
  6. tim4711

    tim4711

    Joined:
    Jan 20, 2018
    Posts:
    2
    Same here! Just updated to Google Mobile Ads Unity plugin version 8.5.2 --> Works perfectly fine in Editor. As soon as built to Android, the initialization callback gets never called. Ads also won't show up. I'm using sample ad unit IDs from admob.
     
    anycolourulike likes this.
  7. anycolourulike

    anycolourulike

    Joined:
    Oct 14, 2017
    Posts:
    5
    Have you set up an Ad Sense account?
     
  8. tim4711

    tim4711

    Joined:
    Jan 20, 2018
    Posts:
    2
    Thanks a lot for your answer, @anycolourulike. Yes, I did set up an AdSense account as well. However I'm not sure about the connection between AdMob and AdSense. In my opinion, these should work independently from each other.

    Thanks again for your support. :)