Search Unity

Unity Ads works on Android and on iPhone but not on iPad

Discussion in 'Unity Ads & User Acquisition' started by paintpaul, Jul 30, 2018.

Thread Status:
Not open for further replies.
  1. paintpaul

    paintpaul

    Joined:
    Mar 8, 2017
    Posts:
    21
    We need your help! We are testing unity ads and its working good on iphone and android phone. but it´s not showing anything on ipad. Is there a common mistake with ads on iPad?

    our ads script looks like this:


    public class ADSManagerScript : MonoBehaviour {

    public bool Rewarded = true;

    public GameObject SystemManager;
    public GameObject SystemUI;
    public GameObject PanelManager;
    public RawImage PaletteImage_02;

    private string gameID = "1745792";

    // Use this for initialization

    void Start () {

    //Get the right gameID for the right Store
    if (Application.platform == RuntimePlatform.Android)
    gameID = "1745792";

    if (Application.platform == RuntimePlatform.IPhonePlayer)
    gameID = "1745793";

    Advertisement.Initialize(gameID, true);

    StartCoroutine(StartADService());
    }

    IEnumerator StartADService()
    {
    // Wait until Unity Ads is initialized,
    // and the default ad placement is ready.
    while (!Advertisement.isInitialized || !Advertisement.IsReady())
    {
    yield return new WaitForSeconds(0.5f);
    }
    }

    // Update is called once per frame
    void Update () {
    }

    //Show our AD yo
    public void ShowAD(bool rewarded)
    {
    Rewarded = rewarded;

    //Unsere UI ausmachen
    SystemUI.SetActive(false);

    ShowOptions options = new ShowOptions();
    options.resultCallback = HandleShowResult;

    Advertisement.Show("video", options);

    //Stop time during ad play
    Time.timeScale = 0.0F;

    //Turn Off other Sounds during ADPlay
    var SystemManagement = SystemManager.GetComponent<SystemManagerScript>();
    SystemManagement.TurnOffSound();

    Debug.Log("Plays AD!");
    }

    //Check status of AD
    void HandleShowResult(ShowResult result)
    {
    if (result == ShowResult.Finished)
    {
    Debug.Log("Video completed - Offer a reward to the player");
    // Reward your player here.

    if (Rewarded == true)
    {
    PaletteController.availablePositions = PaletteController.availablePositions + 1;
    PaletteImage_02.uvRect = new Rect(0, 0.05F * PaletteController.availablePositions, 1, 0);
    PaletteController.SaveColors();

    var PanelManagement = PanelManager.GetComponent<PanelManagerScript>();
    PanelManagement.ActivatePanel(4);
    }


    Time.timeScale = 1.0F;

    //Unsere UI aanmachen
    SystemUI.SetActive(true);

    }
    else if (result == ShowResult.Skipped)
    {
    Debug.LogWarning("Video was skipped - Do NOT reward the player");

    Time.timeScale = 1.0F;

    //Unsere UI aanmachen
    SystemUI.SetActive(true);

    }
    else if (result == ShowResult.Failed)
    {
    Debug.LogError("Video failed to show");

    Time.timeScale = 1.0F;

    //Unsere UI aanmachen
    SystemUI.SetActive(true);
    }

    //Turn Off other Sounds during ADPlay
    var SystemManagement = SystemManager.GetComponent<SystemManagerScript>();
    SystemManagement.TurnBackSound();
    }
    }
     
  2. rasmus-unity

    rasmus-unity

    Moderator

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

    Please check device log in Xcode on the iPad, look for "UnityAds". Usually it will log any errors there.

    Thanks,
    Rasmus
     
  3. paintpaul

    paintpaul

    Joined:
    Mar 8, 2017
    Posts:
    21
    thank you very much for responding!!!

    thats the device log at the beginning when we initalize unity ads (check below for the device log when it should show the ads):

    2018-07-31 17:37:15.316933+0200 KLOTZ[566:129673] I/UnityAds: +[UnityAds initialize:delegate:testMode:] (line:68) :: Initializing Unity Ads 2.1.0 (2100) with game id 1745793 in production mode
    2018-07-31 17:37:15.319816+0200 KLOTZ[566:129850] Could not successfully update network info during initialization.
    2018-07-31 17:37:15.321215+0200 KLOTZ[566:129850] Could not successfully update network info during initialization.
    2018-07-31 17:37:15.321950+0200 KLOTZ[566:129850] I/UnityAds: -[UADSInitializeStateConfig execute] (line:139) :: Unity Ads init: load configuration from https://config.unityads.unity3d.com/webview/2.1.0/release/config.json
    ColorPallettePositioin 0
    PaletteController:Awake()

    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)

    2018-07-31 17:37:15.562380+0200 KLOTZ[566:130021] I/UnityAds: -[UADSInitializeStateLoadWeb execute] (line:209) :: Unity Ads init: loading webapp from https://webview.unityads.unity3d.co...fa0ad16f0b8be334263b719694/release/index.html
    2018-07-31 17:37:16.452914+0200 KLOTZ[566:130021] E/UnityAds: +[UADSWKWebViewApp create:] (line:42) :: Succesfully loaded WKWebKit framework
    2018-07-31 17:37:17.247355+0200 KLOTZ[566:129673] I/UnityAds: +[UADSApiSdk WebViewExposed_logInfo:callback:] (line:59) :: Requesting configuration from https://publisher-config.unityads.u...3.1p1&adapterName=Engine&adapterVersion=2.1.0
    2018-07-31 17:37:17.809020+0200 KLOTZ[566:129673] I/UnityAds: +[UADSApiSdk WebViewExposed_logInfo:callback:] (line:59) :: Received configuration with 2 placements for token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWMiOjEzNCwiY3BpIjoxNDYsImlhcCI6MTcsImx0diI6MjA0LCJwcm8iOjk1LCJ4cHIiOjEzNiwic3ViIjoiZ3JNeXpmbXA2MnVhK1R3R3lKWktpdmVUdjNEc2QyTm14OEhkb3NWcG5xUXhOdWI5cEFhVndSaDFzVndxSmVXSW9DSXVqZz09IiwiaWF0IjoxNTMzMDUxNDM3LCJleHAiOjE1MzQyNjEwMzcsImlzcyI6ImNvbWV0LnVuaXR5YWRzLnVuaXR5M2QuY29tIn0.LhWw5HgguR6wZiW3D_nx5OM2z373otfFMXkNbBCoLtw (A/B group [object Object])
    2018-07-31 17:37:17.855564+0200 KLOTZ[566:129673] I/UnityAds: +[UADSApiSdk WebViewExposed_logInfo:callback:] (line:59) :: Requesting ad plan from https://auction.unityads.unity3d.co...Height=1024&connectionType=wifi&networkType=0
    2018-07-31 17:37:18.648278+0200 KLOTZ[566:129673] I/UnityAds: +[UADSApiSdk WebViewExposed_logInfo:callback:] (line:59) :: AdPlan received with 0 campaigns and refreshDelay 3600
    2018-07-31 17:37:25.607939+0200 KLOTZ[566:129850] [BoringSSL] Function boringssl_session_errorlog: line 2881 [boringssl_session_read] SSL_ERROR_ZERO_RETURN(6): operation failed because the connection was cleanly shut down with a close_notify alert
    2018-07-31 17:37:25.608196+0200 KLOTZ[566:129850] [BoringSSL] Function boringssl_session_errorlog: line 2881 [boringssl_session_read] SSL_ERROR_ZERO_RETURN(6): operation failed because the connection was cleanly shut down with a close_notify alert
    2018-07-31 17:37:46.856051+0200 KLOTZ[566:129673] I/UnityAds: +[UADSApiSdk WebViewExposed_logInfo:callback:] (line:59) :: Requesting ad plan from https://auction.unityads.unity3d.co...Height=1024&connectionType=wifi&networkType=0
    2018-07-31 17:37:47.279819+0200 KLOTZ[566:129673] I/UnityAds: +[UADSApiSdk WebViewExposed_logInfo:callback:] (line:59) :: AdPlan received with 0 campaigns and refreshDelay 3600

    and here when it should show the ads:

    Video failed to show
    ADSManagerScript:HandleShowResult(ShowResult)
    UnityEngine.Advertisements.<Show>c__AnonStorey1:<>m__0(Object, FinishEventArgs)
    UnityEngine.Advertisements.CallbackExecutor:Update()

    (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
     
  4. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Strange that you get "AdPlan received with 0 campaigns and refreshDelay 3600" response from server, as this means we didn't serve ads to that device.

    From your device log, I can see that the iPad identifies as "iPad7,5". Out of curiosity, which iPad model is it?

    But the issue is that we don't match that specific iPad version in our code, will update that right away. Will likely take a day before it's in production though. (Evening time here)

    Thanks for reporting :)

    /Rasmus
     
    Deleted User likes this.
  5. paintpaul

    paintpaul

    Joined:
    Mar 8, 2017
    Posts:
    21
    yeah thank you Rasmus! it´s the "new" 9.7-Inch iPad (6th Gen) -- introduced in "Early 2018".

    Now I tryed a hundred times to get Unity Ads and it didnt work and just now one time it showed Unity Ads... Very strange o_O I hope it gets fixed tomorrow. Thank you very much.
     
  6. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    You're welcome ofc. Thanks again for reporting, we will take a look at why this was missed on our side in first place. And thanks for providing device log, made it lot easier to identity the issue.

    /Rasmus
     
  7. paintpaul

    paintpaul

    Joined:
    Mar 8, 2017
    Posts:
    21
    Hello Rasmus, have you guys been able to fix the the problem?
     
  8. rasmus-unity

    rasmus-unity

    Moderator

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

    No not yet. I'm on vacation this week, but will follow up with team when I'm back in office next week.

    /Rasmus
     
  9. paintpaul

    paintpaul

    Joined:
    Mar 8, 2017
    Posts:
    21
    Hey Rasmus
    ok thank you! Enjoy your vacation!
     
  10. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    @paintpaul, the change has been deployed now, so your iPad Pro device should work.

    /Rasmus
     
  11. paintpaul

    paintpaul

    Joined:
    Mar 8, 2017
    Posts:
    21
    @rasmus-unity thank you! I just checked and it works!! (though it´s not an ipad pro, but a "normal" new ipad). Thank you very much! Your vacation was well deserved :)
     
  12. Chinmay_Gawande

    Chinmay_Gawande

    Joined:
    May 28, 2017
    Posts:
    4
    Hey @rasmus-unity the ads are not working on the 6th gen iPad 9.7-inch
     
  13. nguyenduy2392

    nguyenduy2392

    Joined:
    Mar 15, 2019
    Posts:
    1
    AdPlan received with 0 campaigns and refreshDelay 3600
    LG G6 have same issue. please help me. What happen unity ads
     
    mahmoud93p likes this.
  14. mahmoud93p

    mahmoud93p

    Joined:
    Feb 11, 2015
    Posts:
    66
    i have this problem can you help me please @rasmus-unity
    AdPlan received with 1 campaigns and refreshDelay 0
    iphone x !
     
  15. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
    @mahmoud93p
    That looks like an expected log message, meaning you did receive a campaign to show.

    If you are having an issue getting ads to display, please open a new forum thread and provide as much information as possible. Specifically, we would need:
    • Are you building your game with Unity, XCode, or Android Studio?
    • If Unity, 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?
     
Thread Status:
Not open for further replies.