Search Unity

Doesn't work on Galaxy S5 but works on other android devices

Discussion in 'Unity Ads & User Acquisition' started by _Saj_, Apr 4, 2015.

  1. _Saj_

    _Saj_

    Joined:
    Apr 1, 2015
    Posts:
    10
    After a week of doing this and that, I believe it's a compatibility issue with S5 and Unity Ads (Unity 5). To test, you can either use Unity's Nikolai's sample (https://github.com/wcoastsands/unity-ads-demo), or I created the simplest project with a button to show ads which you can download from the link below.

    Device Log: Please see link below.

    Result S5: Ad seems to be ready as it passes isReady validation but it just reloads the scene.

    Galaxy Nexus/Xperia 2: No problem on both.

    Note that I tried both test and live ad. Both debug and release builds. No difference.

    Lastly note that, if you open any url on S5 from your Unity 5 app (say a link to rate app) and then press hardware back button, same result, Unity 5 reloads the entire scene. Not sure if it is related but seems like a view container issue.

    Code (CSharp):
    1.     void Awake(){
    2.        
    3.         if (Advertisement.isSupported && !Advertisement.isInitialized) {
    4.            
    5.             Advertisement.allowPrecache = true;
    6.  
    7.             // Setting test to false, dev build on etc don't have any effect
    8.  
    9.             #if UNITY_IPHONE
    10.             Advertisement.Initialize(UNITY_AD_IOS, true);
    11.             #elif UNITY_ANDROID
    12.             Advertisement.Initialize (UNITY_AD_ANDROID, true);          
    13.             #endif
    14.            
    15.         } else {
    16.             Debug.Log ("Platform not supported");
    17.         }
    18.  
    19.     }
    20.  
    21.     void Start () {
    22.         adButton.onClick.AddListener(ShowUnityAd);
    23.     }
    24.    
    25.  
    26.     void ShowUnityAd(){
    27.  
    28.         if( Advertisement.isReady() ){
    29.             Advertisement.Show(null, new ShowOptions(){ pause = true });
    30.         }
    31.  
    32.     }

    Test Project:
    http://www.imagnity.com/wp-content/uploads/2015/04/UnityAdsTestS51.zip
    Device Log:
    http://www.imagnity.com/wp-content/uploads/2015/04/UnityAdsTest_DeviceLogs.txt
     
    Last edited: Apr 4, 2015