question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

onRewarded loaded multiple times

See original GitHub issue

Describe the bug Multiple rewards will be acquired when reward videos are shown in the second time.

To Reproduce Steps to reproduce the behavior:

  1. Add codes
AdMob.showRewardVideoAd();
AdMob.addListener('onRewarded', (info) => {
console.log(info)
}
  1. Initiate the reward
  2. Initiate the reward the second time

Expected behavior Only one console.log is shown during the second time

Screenshots If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information): Android 10

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
distantecommented, Dec 7, 2020

Your code is wrong.

Each time the user clicks your button you are creating a new listener. This should be called just one time outside onShowAdClick

AdMob.addListener('onRewarded', async (info: { type: string, amount: number }) => {
      console.log('info', info);
    })
1reaction
rdlabocommented, Dec 7, 2020

Please move to constructor:

    AdMob.addListener('onRewardedVideoAdLoaded', () => {
      AdMob.showRewardVideoAd();
    });
    AdMob.addListener('onRewarded', async (info: { type: string, amount: number }) => {
      console.log('info', info);
    })

These should only be run once.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AdMob loading multiple rewarded videos - Stack Overflow
I have multliple Ad Units setup in Admob, and each one is a rewarded video. My problem is I am rewarded different items...
Read more >
Google admob ad shown after clicking multiple times
is just skipping over the call to Show over and over every time you tap the button, until the ad is actually loaded....
Read more >
Rewards ads was not loading every time with Testing id
Hi Team I have integrated Rewards video ads to my project, but every time it was not loading. Please help me for solution....
Read more >
Rewarded ads | Android - Google Developers
Prerequisites; Always test with test ads; Load a rewarded ad object ... For more information about how the Mobile Ads SDK's test ads...
Read more >
AdMob Rewarded Video - Mobile Ads Garage #7 - YouTube
Publishers can load and show rewarded video directly from Google's ... https://goo.gl/ssxSdA Watch more episodes of Mobile Ads Garage here: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found