Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

Ads not working on some devices

Discussion in 'Unity Ads' started by Silasi, Mar 25, 2020.

  1. Silasi

    Silasi

    Joined:
    Jul 25, 2016
    Posts:
    45
    Hello guys,

    Unity ads work on P30 Lite and A20 2018 but I get no ads on J5 2018. Absolutely no signs of it working. On the other phones it works perfectly. I have reviewed my project settings, the store id, everything is fine. What could be going on?

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.Advertisements;
    3.  
    4. public class AdManager : MonoBehaviour {
    5.  
    6.     string gameId = "xxxxxxx";
    7.     string myPlacementId = "video";
    8.     int delay = 0;
    9.  
    10.     void Start () {
    11.         Advertisement.Initialize (gameId, false);
    12.     }
    13.  
    14.     public void ShowAd(){
    15.         if(delay == 3){
    16.             if(Advertisement.IsReady(myPlacementId)){
    17.                 Advertisement.Show(myPlacementId);
    18.                 delay = 0;
    19.         }
    20.         }else{
    21.             delay++;
    22.         }
    23.     }
    24. }
     
unityunity