I am facing an issue while integrating the Unity ads. My requirement is that after few free game plays user should go through an ad on next game launch and then he can play the game. But when i check if the placement is ready so that i can show the ad in IUnityAdsListener.onUnityAdsReady(). The UnityAds.isReady(placementId: String) always returns false.
I am trying to initialize the sdk with
UnityAds.initialize(this, "<GameId>", this@MainActivity, false)
My IUnityAdsListener is
override fun onUnityAdsStart(p0: String?) {
println("Unity ad start")
}
override fun onUnityAdsFinish(p0: String?, p1: UnityAds.FinishState?) {
println("Unity ad finished")
loadGame()
}
override fun onUnityAdsError(error: UnityAds.UnityAdsError?, message: String?) {
println("Unity ad error, $message, ${error?.name}")
}
override fun onUnityAdsReady(placementId: String?) {
if(UnityAds.isReady(placementId)){
UnityAds.show(this@MainActivity, placementId)
}
println("Unity ad ready, Placement Id: $placementId")
}