Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Unity Ads not showing on IOS

Discussion in 'Unity Ads & User Acquisition' started by kosted, Dec 11, 2017.

  1. kosted

    kosted

    Joined:
    Mar 14, 2015
    Posts:
    104
    I integrated Unity Ads in my iOS game. In the editor, everything works fine. Advertisement.Isready is true. Once deployed on IOS, Isready is always false. I checked my game id on the dashboard, activate Test mode. I don't what to do. Please I could I correct it ?

    Thanks in advance.
     
  2. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Anything in Xcode device log that indicates errors? Also which version of Unity and are you using the engine integrated or asset store version of Ads SDK?

    Thanks,
    Rasmus
     
  3. kosted

    kosted

    Joined:
    Mar 14, 2015
    Posts:
    104
    Thanks for the answer. I use Unity 2017.2.0f3 personal. I use the sdk from the asset store. In xcode, I have this message :

    But In my code I use IOS id got from the dashboard, not the android one.



    Code (CSharp):
    1.      public static String androidGameId = "1439258";
    2.     public static String iosGameId = "1634842";
    3.  
    4.     void Start()
    5.     {
    6.         if(!AutresNiveau.isOnline)
    7.         {
    8.             //TODO : à débloquer quand tout sera prêt
    9.  
    10.             Advertisement.Initialize(iosGameId);
    11.             ShowPub();
    12.         }
    13.  
    14.     }
    15.  
    16.     /// <summary>
    17.     /// On affiche la pub à afficher au joueur
    18.     /// </summary>
    19.     public void ShowRewardedAd()
    20.     {
    21.             //StartCoroutine(showAd());
    22.             if (Advertisement.IsReady("rewardedVideo"))
    23.             {
    24.                 var options = new ShowOptions { resultCallback = HandleShowResult };
    25.                 Advertisement.Show("rewardedVideo", options);
    26.             }
    27.     }
    28.  
    29.     /// <summary>
    30.     /// On affiche la pub à afficher au joueur
    31.     /// </summary>
    32.     public void ShowPub()
    33.     {
    34.         //StartCoroutine(showAd());
    35.         Debug.Log(Advertisement.IsReady("rewardedVideo"));
    36.         if (Advertisement.IsReady("rewardedVideo") && !PlayerPrefs.HasKey("noAds"))
    37.         {
    38.            Debug.Log("je suis dans la méthode");
    39.            var options = new ShowOptions { resultCallback = HandleShowResult };
    40.            Advertisement.Show("rewardedVideo", options);
    41.         }
    42.  
    43.     }
     
  4. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Please check your code to verify you are not initializing somewhere else with the Android id first. From the log it seems you are using the Android game id

    /Rasmus
     
  5. kosted

    kosted

    Joined:
    Mar 14, 2015
    Posts:
    104
    Thank you very much. I used in others files my android id. I replaced them and everything works fine now. Thank you
     
  6. SnailGirl

    SnailGirl

    Joined:
    May 18, 2017
    Posts:
    11
    My Unity ads have stopped working in an already published ios and android game, that was working fine up until now. Do I have to update some ids or anything like that? Currently the ad-button just works like a cheat, which is sort of ruining the game play...
     
    rakbha likes this.
  7. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    @SnailGirl, please share some more information. Did you make any changes?

    Also sounds like you are not checking for IsReady() before showing an ad?

    /Rasmus
     
  8. SnailGirl

    SnailGirl

    Joined:
    May 18, 2017
    Posts:
    11

    No, I haven't done any changes. The ads do come back randomly after a while, and they always work in editor.
    I only use IsReady() to debug. Should it be more integrated?
     
  9. acr1378

    acr1378

    Joined:
    Dec 4, 2014
    Posts:
    76
    I'm having the same problem. Just updated to Unity 2018.
    - "enable Test mode" set to true in the editor
    - Advertisement.isSupported is true.
    - Advertisement.isInitialized is true.
    - The placementID is identical to that shown on the dashboard (and I've tried it with the default placement too with the same result)
    - Advertisment.isReady is always false

    When I run Advertisement.Show, nothing happens (it doesn't return ShowResult.Failed, just does nothing).
     
    Last edited: May 3, 2018
    mabello and CoCoNutti like this.
  10. acr1378

    acr1378

    Joined:
    Dec 4, 2014
    Posts:
    76
    Also, I've tested it
    - without my iPad registered as a test device
    - with my iPad registered as a test device through its IDFA
    - with "Force test mode ON (i.e. use test ads) for all devices" set to true in the dashboard
    It's always returning Advertisement.isReady = false.
     
  11. SnailGirl

    SnailGirl

    Joined:
    May 18, 2017
    Posts:
    11
    I just updated to 2018 too. Ads work in editor, and randomly after build. isReady is always true in editor, and true every 5 clicks or so in Xcode.
     
  12. acr1378

    acr1378

    Joined:
    Dec 4, 2014
    Posts:
    76
    That's better than me. For me, ads are also always working in the editor. But I have yet to have isReady return true when I build it to my iPad.
     
  13. SnailGirl

    SnailGirl

    Joined:
    May 18, 2017
    Posts:
    11
    I had to go into the project settings folder and change the unityConnectSettings manually. Not sure if that will help you too, but you could check. It's described here how and what to do:
    https://forum.unity.com/threads/iss...s-window-missing-assemblies-look-here.494936/
     
  14. acr1378

    acr1378

    Joined:
    Dec 4, 2014
    Posts:
    76
    Thanks for the input. I tried changing the unityConnectSettings manually, which didn't work. But I did learn from that link that there are three different ways of getting the ads package, and they don't all give you the same version.

    I had the Unity Ads package installed through the new Package Manager, which was giving me Version 2.0.7. This is not the latest version so I uninstalled that and did it the old fashioned way: I imported the latest version from the Asset Store, which is Version 2.2.1.

    I tested that out, and it works now!
     
  15. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    A couple of comments
    • You should always check IsReady() before calling Show(). E.g. our algorithms won't show same ads too often, so if you have seen many ads on a device, you will experience that you have to wait a little. So for that reason you should use IsReady() to verify that there actually is ads to show. Also use the callback from Show() to verify that an ad was in fact shown, before you give player a reward.

    • Yes, we are unfortunately aware that the package manager versioning in Unity 2018.1 is confusing. We should be able to align in Unity 2018.2, so for time being, we recommend using the asset store version of Ads SDK
    But seems you figured out already

    /Rasmus
     
  16. SnailGirl

    SnailGirl

    Joined:
    May 18, 2017
    Posts:
    11
    I understand! All that makes perfect sense and it does seem like I had a setup like that, (the daily reward got called instead of the ad reward. not important, a mistake in my code and nothing to to with ads). Switching to the asset store version seems to have done the trick for me too, apart from messing with files!

    Thanks a lot for the help rasmus!
     
  17. acr1378

    acr1378

    Joined:
    Dec 4, 2014
    Posts:
    76
    Thank you Rasmus. I'll make sure to check isReady before calling anything.

    I did figure it out on my own, but I also wasted a full development day trying to figure it out. You should make a very clear warning post on this forum alerting users that the Package Manager is not reliable yet.
     
    alphadogware likes this.
  18. ukn

    ukn

    Joined:
    Jan 31, 2015
    Posts:
    3
    I'm still having the problem after I updated to 2018.1

    - "Enable built-in Ads extension" is true without plugin from asset store.
    - "Enable built-in Ads extension" is false with plugin from asset store.

    It's always returning Advertisement.isReady = false in iOS.

    Sometime I've encountered this problem before updating, but usually I can solve with changing these settings and cleaning iOS build.
     
  19. ukn

    ukn

    Joined:
    Jan 31, 2015
    Posts:
    3
    Now it's solved.
    I switched off the UnityAds at the Services window and initialized by myself.
    Of course I used the plugin from the asset store.

    Code (CSharp):
    1. IEnumerator Start() {
    2.  
    3.     string gameId = "";
    4. #if UNITY_IOS
    5.     gameId = GAMEID_IOS;
    6. #elif UNITY_ANDROID
    7.     gameId = GAMEID_ANDROID;
    8. #endif
    9.  
    10.     Advertisement.Initialize(gameId, false);
    11.  
    12.     while (!Advertisement.isInitialized || !Advertisement.IsReady(PLACEMENTID)) {
    13.         yield return new WaitForSeconds(0.5f);
    14.     }
    15.  
    16.     Advertisement.Show();
    17. }
     
    KeithAtherton likes this.
  20. Deleted User

    Deleted User

    Guest

    I thought the point of the Package Manager is so you can update the available version of packages like Unity Ads without having to wait for another Unity Editor release. Is there a bug in the Package Manager that is preventing an update of the available Unity Ads package?
     
  21. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Deleted User likes this.
  22. Deleted User

    Deleted User

    Guest

    OK, got it, thanks.
     
  23. wiganda

    wiganda

    Joined:
    Feb 24, 2018
    Posts:
    14
    internal unity ads work in 2018.1.6 yet? Still didn't work in 2018.1.5...
     
  24. Deleted User

    Deleted User

    Guest

    It’s been working for me with the latest from
    The latest version from the Package Manager has been working for me.
     
  25. Doompapa

    Doompapa

    Joined:
    Apr 29, 2017
    Posts:
    1
    Thanks a lot, the same question as me and when I updated it has been work!
     
    Deleted User likes this.
  26. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,609
    I have this issue on all 2018 versions, too.
     
  27. kosted

    kosted

    Joined:
    Mar 14, 2015
    Posts:
    104
  28. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,609
  29. Mahnoor_Dev

    Mahnoor_Dev

    Joined:
    Jan 21, 2021
    Posts:
    1
    how