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

Question about ads and compatibility

Discussion in 'Unity Ads & User Acquisition' started by imotski, Nov 16, 2015.

  1. imotski

    imotski

    Joined:
    Jul 27, 2015
    Posts:
    39
    Hello people,

    My game will be for iOS, android and windows phone platform.
    I have two questions about ads and my game compatibility.

    If I just want a game with advertising, do I need something special encrypted or whatever? Or is it enough to put the application on the App Store / Google Play so ads will be appear with " popularity "?

    Another thing: the development of the game right from the beginning is that I set the screen size of the iPhone 5. So, do I need separately adapting my game for each model of the iPhone screen, Samsung etc., or there is "something" which adapt to every screen?

    Thanks
    Best regards
     
  2. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Hi,

    Assuming you will be using Unity Ads for your game, and your game is developed using Unity.

    1. Unity Ads currently supports Android and iOS (see https://unityads.unity3d.com/help/Frequently Asked Questions/faq)

    2. You need to implement code to show ads in the game, e.g. after a level, to get a reward etc. See http://docs.unity3d.com/Manual/UnityAdsHowTo.html and http://blogs.unity3d.com/2015/04/15/a-designers-guide-to-using-video-ads/

    3. Depending on your type of game, see e.g. http://docs.unity3d.com/Manual/HOWTO-UIMultiResolution.html (UI) or search for "unity mobile resolution scale"

    Hope this help.

    -Rasmus
     
  3. imotski

    imotski

    Joined:
    Jul 27, 2015
    Posts:
    39
    This helps me a lot. Thanks bro :)
     
  4. imotski

    imotski

    Joined:
    Jul 27, 2015
    Posts:
    39
    UPDATE: I solve my problem after watching this video:


    I hope that will helps to someone.

    Kind regards :)

    I put this code on empty object but ads are not visible.
    or this code is not enough?

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.Advertisements;
    3.  
    4. public class UnityAdsExample : MonoBehaviour
    5. {
    6.   public void ShowAd()
    7.   {
    8.     if (Advertisement.IsReady())
    9.     {
    10.       Advertisement.Show();
    11.     }
    12.   }
    13. }
    I checked mark on " enable test mode ".
    My unity version: 5.2.2f1
    Message on my console:
    UnityAdsEditor: Initialize(1017331, True);
    UnityEditor.Advertisements.UnityAdsEditor:EditorOnLoad()
     
    Last edited by a moderator: Nov 22, 2015
  5. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    How do you invoke the ShowAd() method from your game?
     
  6. imotski

    imotski

    Joined:
    Jul 27, 2015
    Posts:
    39
    I made a new scene only for ads, and I invoke ads in " lose " script with -> Application.LoadLevel ("name of ads scene ") every time when I lose.

    Now, display screen says that " Here would be your Ad unit ". Will be appeared real ads when the game gets on the App Store / Google Play?
     
    Last edited: Nov 22, 2015
  7. imotski

    imotski

    Joined:
    Jul 27, 2015
    Posts:
    39
  8. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    I assume you have tested it on a device, right? The "Here would be your Ad unit" message is only shown in the editor, and you should see either real or test ads on a device, depending on your settings.

    -Rasmus
     
  9. imotski

    imotski

    Joined:
    Jul 27, 2015
    Posts:
    39
    Yes, but on my device is the "Here would be your Ad unit" message too. :(

    This is my code:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using UnityEngine.Advertisements;
    4.  
    5. public class myAds : MonoBehaviour
    6. {
    7.   //Use this for initialization
    8.   void Start ()
    9.   {
    10.     Advertisement.Initialize ("1017331", true);
    11.     StartCoroutine (ShowAdWhenReady ());
    12.   }
    13.  
    14.   IEnumerator ShowAdWhenReady ()
    15.   {
    16.     while (!Advertisement.IsReady())
    17.       yield return null;
    18.  
    19.     Advertisement.Show ();
    20.   }
    21. }
     
    Last edited by a moderator: Nov 29, 2015
  10. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    You mentioned earlier you are using Unity 5.2.2f1, right? In that case you don't need to call Advertisement.Initialize() in code, as the engine will take care of initialization for you (however shouldn't make any difference as the call will just be ignored).

    But beside from this, I create a simple project using Unity 5.2.2f1 with your code. When playing in editor, it shows the "Here would be your Ad unit" message, however when deployed to an Android device it shows a real ad.

    Can you provide a screenshot of device showing the "Here would be your Ad unit" message?

    -Rasmus
     
  11. imotski

    imotski

    Joined:
    Jul 27, 2015
    Posts:
    39
    Thank you Rasmus for your help.

    Yes, I use Unity 5.2.2f1. Now, I removed Advertisement.Initialize() in code.
    This is my display when I test my game (I use unity remote 4).

    http://i68.tinypic.com/3wkfl.jpg

    I tried on my iPhone 5c, Android tablet, Android smartphone. Everywhere is the same situation. I carried about build settings.

    And this is my console during test. http://i67.tinypic.com/2ev96qv.jpg

    Before few minutes, I created new project, put the same code, and I had the same message on device display. Is there any impact if I'm from Croatia?
     
  12. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Makes sense then. From http://docs.unity3d.com/Manual/UnityRemote4.html:
    Can you try to deploy to the device (i.e. build for Android, not using Unity Remote), and verify it works?

    Thanks,
    Rasmus
     
  13. imotski

    imotski

    Joined:
    Jul 27, 2015
    Posts:
    39
    Is it works with simulators? (i.e. iOS simulator)
     
  14. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Yes, it should work on simulators, at least I've tested here with Android simulator.
     
  15. imotski

    imotski

    Joined:
    Jul 27, 2015
    Posts:
    39
    It's working bro :)
    Here is picture.
    http://i67.tinypic.com/1zdn978.jpg

    This is need to be like this, right? :)

    Thank you a thousand times!! :)
    I used Genymotion for simulator. If someone needs help about set up this simulator, feel free to contact me :))))))