I am working with the AdMob-Plus plugin and trying to integrate the RewardedAd as shown here.
THE ISSUE:
I want to offer 3 coins for every RewardedAd watched. My main issue is that I am unable to figure out how to track successfully after a user has watched a complete RewardedAd and increment the existing count of the coins in the user account by adding the new coin value to it and show this new value to the user in the UI.
EXAMPLE:
If the user already has 6 coins in his account and watches a RewardedAd, then his account should show the new balance as 9 coins. How can I achieve this?
THE CODE THAT I HAVE TRIED SO FAR:
async loadRewardsAd(): Promise<void> {
this.rewarded = new this.admob.RewardedAd({
adUnitId: this.adRewardedId,
serverSideVerification: {
customData: 'coin=3',
userId: '1234567',
}
});
// Load rewarded
await this.rewarded.load();
// Display rewarded
await this.rewarded.show();
}