I can't figure out how to use the listener to reward the user for watching the video.
package page : https://pub.dartlang.org/packages/firebase_admob
RewardedVideoAd.instance.listener =
(RewardedVideoAdEvent event, [String rewardType, int rewardAmount]) {
if (event == RewardedVideoAdEvent.rewarded) {
setState(() {
// Here, apps should update state to reflect the reward.
_goldCoins += rewardAmount;
});
}
};
All I managed to do is display the ad, I have no clue how to use the listener.
This is an example: https://github.com/Maherr/listener/blob/master/lib/main.dart
How to change rewarded
to true
?