Search Unity

Unity ads just working on some selected devices.

Discussion in 'Unity Ads & User Acquisition' started by Ujjawal49, Sep 13, 2021.

  1. Ujjawal49

    Ujjawal49

    Joined:
    Apr 26, 2018
    Posts:
    35
    Hey guys so I tested my unity ads with test mode on and it worked fine in my device. So I published it and turned off the test mode now the problem is that the ads doesn't show up in my device(Samsung). Then I tested in another old device I had(Lenovo) and the ads did work on this one. I tested on 2 Samsung devices and the ads didn't show up in any of the device. Please help!!
     
  2. Unity_Quinn

    Unity_Quinn

    Unity Technologies

    Joined:
    Nov 6, 2020
    Posts:
    102
    Hi @Ujjawal49, sorry to hear about this.

    Would you be able to provide some more information about this issue?
    • Are you building your game with Unity, XCode, or Android Studio? Which version are you using?
    • Which version of the Ads SDK are you using?
    • Can you share the code you are using to integrate Unity Ads?
    • Can you provide a device log from your app when Unity Ads is initialized?
    • Are you using mediation? If so, which version of the mediation SDK and adapter are you using?
    • How pervasive is this problem? Is it reproducible 100% of the time, or do you have metrics on how often it happens?
    • Would you mind confirming the device models and Android OS versions you're testing with?
    If you can also provide these details, they would be very helpful for our investigation:
    • A store link to the project or a build of the project
    • The game ID of the project
    Looking forward to hearing from you :)
     
  3. Ujjawal49

    Ujjawal49

    Joined:
    Apr 26, 2018
    Posts:
    35
    First of all thanks for responding :)
    Here is the information u needed:

    • I'm building the game with unity(2020.1)
    • I'm using unity ads 3.4.9
    • Here is my code

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.Advertisements;
    5. using System;
    6.  
    7. public class AdsManager : MonoBehaviour, IUnityAdsListener
    8. {
    9.  
    10.     public static AdsManager Instance;
    11.  
    12.     Action onRewardedAdSuccess;
    13.  
    14.     private void Awake()
    15.     {
    16.         //Instance = this;
    17.         if (!Instance)
    18.         {
    19.             Instance = this;
    20.             DontDestroyOnLoad(gameObject);
    21.         }
    22.         else
    23.         {
    24.             //Duplicate GameManager created every time the scene is loaded
    25.             Destroy(gameObject);
    26.             return;
    27.         }
    28.     }
    29.  
    30.     void Start()
    31.     {
    32.         Advertisement.Initialize("4282775");
    33.         Advertisement.AddListener(this);
    34.     }
    35.  
    36.     public void PlayAd() {
    37.         if (Advertisement.IsReady("Interstitial_Android")) {
    38.             Advertisement.Show("Interstitial_Android");
    39.         }
    40.     }
    41.  
    42.     public void PlayRewardedAd(Action onSuccess)
    43.     {
    44.         onRewardedAdSuccess = onSuccess;
    45.         if (Advertisement.IsReady("Rewarded_Android")) {
    46.             Advertisement.Show("Rewarded_Android");
    47.         } else {
    48.             //Debug.Log("RewardedVideo Not ready");
    49.             GameManager.Instance.videoNotReadyPanel.SetActive(true);
    50.         }
    51.     }
    52.  
    53.     public void OnUnityAdsReady(string placementId)
    54.     {
    55.         //Debug.Log("ad is ready");
    56.     }
    57.  
    58.     public void OnUnityAdsDidError(string message)
    59.     {
    60.         //Debug.Log("Error : " + message);
    61.     }
    62.  
    63.     public void OnUnityAdsDidStart(string placementId)
    64.     {
    65.         //Debug.Log("Video Started");
    66.     }
    67.  
    68.     public void OnUnityAdsDidFinish(string placementId, ShowResult showResult)
    69.     {
    70.         if(placementId == "Rewarded_Android" && showResult == ShowResult.Finished)
    71.         {
    72.             onRewardedAdSuccess.Invoke();
    73.         }
    74.     }
    75. }
    76.  
    • I don't know how to give u the device log :(
    • No I'm not using any mediation.
    • the problem is reproducible 100% of the time
    • I tested on Samsung Galaxy f41 (android 11) and the ads didn't work. Them tested in redmi S2(or Y2)(android 8.1) and Lenovo Vibe K4 note(android 6) and the ads worked on both the devices.

    Here is the game link - https://play.google.com/store/apps/details?id=com.Solodevstudio.GreedyBirds

    One more thing is that the game crashes in some devices at start and I believe its due to unity ads.
     
    Last edited: Sep 18, 2021
  4. Ujjawal49

    Ujjawal49

    Joined:
    Apr 26, 2018
    Posts:
    35
    Edit*
    Okay so I updated the unity ads to the latest version and now it seems to work :)
     
  5. Unity_Quinn

    Unity_Quinn

    Unity Technologies

    Joined:
    Nov 6, 2020
    Posts:
    102
    Awesome! Glad to hear it's working now! :):):)