Hi i have a problem… i have this script attached to the main camera to display the videoads (the example script on the docu).
using UnityEngine;
using System.Collections;
using UnityEngine.Advertisements;
public class ADHelper : MonoBehaviour {
void Awake() {
if (Advertisement.isSupported) {
Advertisement.allowPrecache = true;
Advertisement.Initialize("17507",false);
} else {
Debug.Log("Platform not supported");
}
}
void OnGUI() {
if(GUI.Button(new Rect(10, 10, 150, 50), Advertisement.isReady() ? "Show Ad" : "Waiting...")) {
// Show with default zone, pause engine and print result to debug log
Advertisement.Show(null, new ShowOptions {
pause = true,
resultCallback = result => {
Debug.Log(result.ToString());
}
});
}
}
}
when i try on my pc after few second the button text is “Show Ad” and if i click on the button, it show the example picture,
but if i try on my android tablet the button text is “Waiting” and don’t change state, so i can’t see the video…
I guess the problem is Advertisement.isReady() that on my pc became true after some seconds and on my mobile remain false why??
In your Initilization() method call, the second parameter is set false, disabling testMode. Would you mind setting it to true for the time being and trying the build again, just to make sure you’re getting sample ads in testMode?
I double checked the settings for your game. It looks good from our end.
Hi
I double build and test my app using the test mode
so in the code:
Advertisement.Initialize(“17507”,true);
but i have the same problem… the text still remain “Waiting”.
Don’t know what’s wrong… becouse yesterday using this plug in another game i did it works fine (i see the videos) but with this game no
Thank you for the report! I tried reproducing it last night but wasn’t getting the issue consistently. Trying to narrow down the conditions for it. How the GameObject is named looks to be part of the issue. Trying to figure out what’s causing the inconsistency now.
If you’re referring to the buttons that overlay the video ads, I’d like to see the same thing. Not sure yet if those buttons have to be skinned within within the SDK or if there’s some customization feature available to devs to set for themselves. I believe it’s the former, though. Would like to see the later, for better fit-and-finish and style integration.
On my list of things to look into. Thanks for bringing it up.