Search Unity

Is unity ads only for android 5.0?

Discussion in 'Unity Ads & User Acquisition' started by MORVOC, Aug 23, 2015.

  1. MORVOC

    MORVOC

    Joined:
    Mar 31, 2015
    Posts:
    4
    I have been making an android game and tried integrating it with unity ads. Everything works fine in the editor, test ads show up. But, when I use it on an android device, the ads don't show up. The ad ID is the same in both the game and the unity ads website. I'm not sure what's wrong and thought maybe it was that my tablet was a little outdated. So, I was wondering if it was an issue with my script or with the version of the device.

    Here is my script for the ads that i am currently using...

    using System.Collections;
    using UnityEngine.Advertisements;

    public class AdManager : MonoBehaviour {
    private const int counterReset = 3;
    public static int counterForAds = counterReset;
    [SerializeField] string gameID = "#####";

    void Awake()
    {
    Advertisement.Initialize (gameID, false);
    }
    public void ShowAd()
    {
    if (Advertisement.isReady ())
    Advertisement.Show ();
    }

    void Start() {
    counterForAds--;

    if (counterForAds == 0) {
    resetCounter();
    Advertisement.Show(null, new ShowOptions {
    pause = true,
    resultCallback = result => {

    }
    });
    }
    }

    public static void resetCounter() {
    counterForAds = counterReset;
    }
    }
     
  2. TheAlmightyPixel

    TheAlmightyPixel

    Joined:
    Jun 21, 2014
    Posts:
    263
    I published a game on the Play store with UnityAds (and got a mighty 0,5€ off of it), and tested it on an Android device running Android 4.1, which worked just fine. I also tried it with a device that runs Android 4.0 and a device which runs Android 5.0 - without problems.
    • Is your phone connected to the internet? (this may be a stupid question, but this actually happened to me once)
    • Is your phone restricting the internet usage of the app?
    • And, of course, is the piece of code used to show the ad actually being called? (Do you have the script attached to anything?)
     
  3. MORVOC

    MORVOC

    Joined:
    Mar 31, 2015
    Posts:
    4
    Yup, one of the requirements for the game is to have internet. I've been connected to it everytime I play it, so that shouldn't be an issue. I have the script attached to a scoreboard that shows up when you die in the game, so it pops up when you die... At least in the editor it works.