Unity ads not showing rewarded video ad.
Hi, I am using unity ads from service window, normal add ir working fine but when it comes to rewarded ad it is not popping up.
Debug.Log(Advertisement.IsReady("rewardedVideoZone"));
this line always return a false value.
This is my configuration in service window.
And this is the code for showing rewarded ad.
public void ShowRewardedAd()
{
Debug.Log(Advertisement.IsReady("rewardedVideoZone"));
if (Advertisement.IsReady("rewardedVideoZone"))
{
var options = new ShowOptions { resultCallback = HandleShowResult };
Advertisement.Show("rewardedVideoZone", options);
}
}
private void HandleShowResult(ShowResult result)
{
switch (result)
{
case ShowResult.Finished:
Debug.Log("The ad was successfully shown.");
//
// YOUR CODE TO REWARD THE GAMER
// Give coins etc.
break;
case ShowResult.Skipped:
Debug.Log("The ad was skipped before reaching the end.");
break;
case ShowResult.Failed:
Debug.LogError("The ad failed to be shown.");
break;
}
}
Any help will be highly appreciated.
Answer by sam61 · Apr 08, 2016 at 07:47 PM
@aleexaib please use
Advertisement.IsReady("rewardedVideo")
and
Advertisement.Show("rewardedVideo", options)
I pushed a change that'll fix these in the documentation. Sorry for the hassle.
@sam61 It worked, thank you so much for your quick response, really appreciated. But why unity will do such a blunder.
It's still wrong in Services tab > ADS > Code Samples > Rewarded :s
Thank you for the answer. :)
Worked for me too.Thanks!. After trying all options. Unity should update this. I thought my app had bugs, spent like 3 days trying to debug.