Open diegoestacho999 opened 6 years ago
document.addEventListener('admob.rewardvideo.events.REWARD',function(event){ /** I noticed users would be rewarded multiple times on 1 video so here's a way to prevent that from happening **/
Var seenAd = false;
if(seenAd==false){ seenAd=true; alert("you are rewarded for watching the ad");} } )
P.S. reward can be replaced with the following (LOAD, LOAD_FAIL, OPEN, CLOSE, EXIT_APP)
Is this what I call right after being able to view the reward video? today I have something like
//calls and displays the reward video launchVideoReward() { let rewardConfig: AdMobFreeRewardVideoConfig = { //isTesting: true, autoShow: true, id: 'ca-app-pub-8000726989219599/8229278077' }; this.admob.rewardVideo.config(rewardConfig); this.admob.rewardVideo.prepare().then(() => { console.log('video executado com sucesso'); }) }
//I think you are using typescript. i am not to familiar with that but here's how i got it to work:
//on my index.html I placed this code inside script tags like such:
// on my application what this did was prepare my rewards and interstitial so i could them later: // afterwards I am able to call them inside of another function for my game like this.
function myGame(){ document.addEventListener('admob.rewardvideo.events.LOAD', function(event) { admob.rewardvideo.show() )
//the code above only works if admob loads the ad into the app else it will do nothing
document.addEventListener('admob.rewardvideo.events.REWARD', function(event) { admob.rewardvideo.show() ) }
myGame()
/the code above only works if admob detects that the user has finished watching the whole reward video else it will do nothing /
/the word load and reward can be inter-changed with one of the following (REWARD,LOAD, LOAD_FAIL, OPEN, CLOSE, EXIT_APP)/
//I hope this helps you out
Friend, have you managed to resolve the issue of doubling the reward? I still have this same problem here, even after using your code. What can we do to solve it?
The video is displayed correctly, but I do not know how to proceed after the video is displayed. Is it necessary to manipulate some event, if so, what event would that be? I did the integration with Unity, but when I click on the close of the video, it closes the application, is that right?