We are having issues with ads displaying continuously.
Our app is not production so it is currently running under test mode.
Can you please help with the following issues?
Thank you.
Issues
1)In our tests ads stop displaying after couple times. Why is this?
2)Video ads show but Result from Advertisement.Show call is not correct
when the user watches the video
completely.
The current result is "Failed" but this value should be "Finished".
Why is this?
Code to run the ads is below.
using UnityEngine;
using System.Collections;
using UnityEngine.Advertisements;
public class Test : MonoBehaviour
{
string UnityApplicationId = "36053";
void InitializeUnityAds (){
if (Advertisement.isSupported) {
Advertisement.allowPrecache = true;
Advertisement.Initialize (UnityApplicationId, false);
} else {
Debug.Log ("Platform not supported");
}
}
void Awake (){
InitializeUnityAds ();
}
public void OnPlayVideoAd (){
if (!Advertisement.isReady ())
return;
Advertisement.Show (null, new ShowOptions {
pause = true,
resultCallback = result => {
Debug.Log(result.ToString());
if(result.ToString().Equals("Finished")){
//handle success
}
}
});
}
}
↧