Answer the question
In order to leave comments, you need to log in
Explain how rewarded advertising logic works (with ready-made code)?
Again, I use Easy Mobile Pro and they write the following in their documentation:
Working with Rewarded Ads
The method to show a rewarded ad requires it to be already loaded. Therefore you should check for the ad's availability before showing it.
// Check if rewarded ad is ready
bool isReady = Advertising.IsRewardedAdReady();
// Show it if it's ready
if (isReady)
{
Advertising.ShowRewardedAd();
}
// Subscribe to rewarded ad events
void OnEnable()
{
Advertising.RewardedAdCompleted += RewardedAdCompletedHandler;
Advertising.RewardedAdSkipped += RewardedAdSkippedHandler;
}
// Unsubscribe events
void OnDisable()
{
Advertising.RewardedAdCompleted -= RewardedAdCompletedHandler;
Advertising.RewardedAdSkipped -= RewardedAdSkippedHandler;
}
// Event handler called when a rewarded ad has completed
void RewardedAdCompletedHandler(RewardedAdNetwork network, AdLocation location)
{
Debug.Log("Rewarded ad has completed. The user should be rewarded now.");
}
// Event handler called when a rewarded ad has been skipped
void RewardedAdSkippedHandler(RewardedAdNetwork network, AdLocation location)
{
Debug.Log("Rewarded ad was skipped. The user should NOT be rewarded.");
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question