Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity Ads don't play on Pixel 3 (android Pi) - Editor and Older device okay...

Discussion in 'Unity Ads & User Acquisition' started by zeroiq50, May 27, 2019.

  1. zeroiq50

    zeroiq50

    Joined:
    Jun 15, 2013
    Posts:
    15
    Hi folks, I have scoured the forums for an answer to this and, although I have found similar issues/fixes, noting seems to match/work for me.
    I am on Unity 2019.1.4 and using Ads 3.0 (tried inbuilt and package)
    My issue is: My Google Pixel 3 running Android 9 seems to be blocking video Ads, I have tested my app on an old Tab 3 (android 4.2) and Ads play just fine, and of course the Editor is cool too.
    I have tried several different methods; using Monetization, using Advertisements - with and without IUnityAdsListener... still no joy.
    As a test I installed a game I knew incorporated Unity Ads (Crossy Road) - it too had the same issue! Video ads would not play; UNLESS I enabled local storage access in my device permissions - I tried to implement Android.Permissions but had little luck in engine (maybe need to do this through Android Studio?)
    Anyhoo, any help would be greatly appreciated

    Thanks

    this is my current code:

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.Advertisements;
    5.  
    6. public class AdsManager : MonoBehaviour, IUnityAdsListener {
    7.  
    8.     public static AdsManager _current { get; private set; }
    9.     string placementID = "", gameID = "";
    10.     bool testMode = true, adReady = false;
    11.  
    12.     private void Awake()
    13.     {
    14.         if(_current == null)
    15.         {
    16.             _current = this;
    17.         }
    18.         else
    19.         {
    20.             Destroy(this.gameObject);
    21.         }
    22.        
    23.     }
    24.  
    25.     private void Start()
    26.     {
    27. #if UNITY_ANDROID
    28.         gameID = "nunyabusiness!";
    29. #elif UNITY_IOS
    30.         gameID = "nunyabusiness!";
    31. #endif
    32.         placementID = "rewardedVideo";
    33.  
    34.         if(Advertisement.isSupported)
    35.         {
    36.             Advertisement.AddListener(this);
    37.             Advertisement.Initialize(gameID, testMode);
    38.         }
    39.        
    40.     }
    41.  
    42.     public void ShowRewardAd()
    43.     {
    44.         if (adReady == true)
    45.         {
    46.             Advertisement.Show(placementID);
    47.         }
    48.  
    49.     }
    50.  
    51.     public void OnUnityAdsReady(string _placementId)
    52.     {
    53.         if(_placementId == placementID)
    54.         {
    55.             adReady = true;
    56.         }
    57.     }
    58.    
    59.     public void OnUnityAdsDidFinish(string placementId, ShowResult showResult)
    60.     {
    61.         switch (showResult)
    62.         {
    63.             case ShowResult.Failed:
    64.                 GameManager._current.ContinueAfterAd(false);
    65.                 break;
    66.             case ShowResult.Skipped:
    67.                 GameManager._current.ContinueAfterAd(false);
    68.                 break;
    69.             case ShowResult.Finished:
    70.                 GameManager._current.ContinueAfterAd(true);
    71.                 break;
    72.             default:
    73.                 break;
    74.         }
    75.         adReady = false;
    76.     }
    77.  
    78.     public void OnUnityAdsDidError(string message)
    79.     {
    80.         adReady = false;
    81.     }
    82.  
    83.     public void OnUnityAdsDidStart(string placementId)
    84.     {
    85.         //throw new System.NotImplementedException();
    86.     }
    87. }
     
  2. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    I can't help but I can say this has just started happening to me too. My game on the store has been working fine but recently started to fail when trying to show video ads on a Pixel 2 running Android 9.0. It's still working on a Galaxy 5 running 5.1.1, and also working in debug mode connected to the profiler. I have write permissions set to "External" in project settings. Unity 2018.4.1.
     
  3. zeroiq50

    zeroiq50

    Joined:
    Jun 15, 2013
    Posts:
    15
    I am sorry to hear that JohnnyFactor. Alas I have no good news/fix yet either; out of desperation I am going to try and switch to AdMob, just as a test, but I doubt the outcome will be any different... unless AdMob data is stored in the app-specific storage instead of external? I am actually thinking of ditching Ads for IAP tbh.
    just a thought, If Ads need user permission, how many players are actually going to grant access? less and less I think?