- Home /
Rewarded video ads Chartboost - Unity 5
Am tring to integrate video rewarded ads in my game how can I show video ads and handle if the ad is successfully shown to reward the player ? I couldn't find any thing about that on Chartboost docs it only says
Chartboost.showRewardedVideo(CBLocation.MainMenu);
But how to handle success or failure from ad and where to ad the code to reward the player if the ad is successfully shown ?
Comment
Best Answer
Answer by Tuncer · Jan 25, 2016 at 03:09 PM
void OnEnable() {
// Listen related event
Chartboost.didCompleteRewardedVideo += didCompleteRewardedVideo;
}
void OnDisable() {
// Remove handler
Chartboost.didCompleteRewardedVideo -= didCompleteRewardedVideo;
}
void didCompleteRewardedVideo(CBLocation location, int reward){
Debug.Log("Completed video with reward: "+reward);
}
Docs :
https://answers.chartboost.com/hc/en-us/articles/200780379 https://answers.chartboost.com/hc/en-us/articles/204213169