Edit: Google AdMob does support rewarded ads without mediation.
You can use this unit id to test it: rewardAd.LoadAd("ca-app-pub-3940256099942544/5224354917")
Make sure to use FirebaseAdMob v1.51+
FirebaseAdMob v1.30 adds support for rewarded video ads. Rewarded video ads are video ads where the user is rewarded if he watches the full video.
How is the user rewarded is up to you. In many games for example, the users will receive an extra life if they watch the video ad.
Google AdMob do not provide these ads. You need to use the mediation feature to add an ad network that does support rewarded videos. You can see the features that each ad network supports here: https://firebase.google.com/docs/admob/android/mediation-networks#supported-ad-formats
I've tested it with InMobi.
The first step is to integrate the third party ad network as explained here: AdMob Mediation (with InMobi)
Working with RewardedVideoAd is similar to working with InterstitialAds. You first need to call LoadAd. Note that the ad unit is passed to the LoadAd method and not to the Initialize method.
The ReceiveAd event will be raised when an ad is ready. Now you can call Ad.Show to show the ad. If the user will fully watch the ad then the Rewarded event will be raised.
Example:
You can use this unit id to test it: rewardAd.LoadAd("ca-app-pub-3940256099942544/5224354917")
Make sure to use FirebaseAdMob v1.51+
FirebaseAdMob v1.30 adds support for rewarded video ads. Rewarded video ads are video ads where the user is rewarded if he watches the full video.
How is the user rewarded is up to you. In many games for example, the users will receive an extra life if they watch the video ad.
Google AdMob do not provide these ads. You need to use the mediation feature to add an ad network that does support rewarded videos. You can see the features that each ad network supports here: https://firebase.google.com/docs/admob/android/mediation-networks#supported-ad-formats
I've tested it with InMobi.
The first step is to integrate the third party ad network as explained here: AdMob Mediation (with InMobi)
Working with RewardedVideoAd is similar to working with InterstitialAds. You first need to call LoadAd. Note that the ad unit is passed to the LoadAd method and not to the Initialize method.
The ReceiveAd event will be raised when an ad is ready. Now you can call Ad.Show to show the ad. If the user will fully watch the ad then the Rewarded event will be raised.
Example:
B4X:
Sub Globals
Private ad As RewardedVideoAd
End Sub
Sub Activity_Create(FirstTime As Boolean)
ad.Initialize("ad")
End Sub
Sub Activity_Resume
ad.LoadAd("ca-app-pub-12345675929340/33333326118")
End Sub
Sub ad_ReceiveAd
Log("Ad received. Now wait for the right moment to show the ad.")
End Sub
Sub Ad_Rewarded (Item As Object)
'Item is currently not used
ToastMessageShow("You are rewarded!!!", True)
End Sub
Sub Ad_FailedToReceiveAd (ErrorCode As String)
Log("Failed: " & ErrorCode)
End Sub
Sub Ad_AdClosed
Log("Closed")
End Sub
Sub Ad_AdOpened
Log("Opened")
End Sub
Sub Activity_Click
If ad.Ready Then ad.Show
End Sub
Last edited: