i am using unity reward based ads in my android/ios game. but when i check it
Advertisement.IsReady (rewardVideoID)
always return false because in ads script if check in Awake unity ads initialization is false
*void Awake ()
{
Debug.Log ("Unity ads ini state : " + Advertisement.isInitialized); //it is false everytime
}
*
here i want to know why unity ads are not auto initializing. i used unity ads in my previous project
it is initializing automatically
Well, I had the same problem, I think that’s a bug. I fixed it by initializating it manually.
You can add this to your ad manager, or just create a new one:
using UnityEngine;
using UnityEngine.Advertisements;
public class UnityAdsInitializer : MonoBehaviour
{
[SerializeField]
private string
androidGameId = "18658",
iosGameId = "18660";
[SerializeField]
private bool testMode;
void Start ()
{
string gameId = null;
#if UNITY_ANDROID
gameId = androidGameId;
#elif UNITY_IOS
gameId = iosGameId;
#endif
if (Advertisement.isSupported && !Advertisement.isInitialized) {
Advertisement.Initialize(gameId, testMode);
}
}
}
;D
Had to thank you since you give the clue I need to find the problem I was having with Heyzap and UnityAds. Basically I was implementing the Heyzap SDK on an old project, with have using only the UnityAds. All the other services I implemented was dispatching the events for rewarded videos, except UnityAds.
The point is: In the Projects/UnityConnectSettings the connection for me was set to initialize automatically, and the Services component in Unity doens’t show to you anything about this on Unity 2017.4.6f.
I was searching for something for 4 days to solve this problem, until I reach this topic. I was not using Advertisement.Initialize anymore like you, but I remember that Unity could start automatically and them I could figure out the problem.
Heyzap Dashboard doesn’t have nothing about this, on internet nobody said anything about it, so I’m just making this registration for history. Thanks.