ratson / cordova-plugin-admob-free

New development has been moved to "admob-plus-cordova", https://github.com/admob-plus/admob-plus/tree/master/packages/cordova
https://github.com/admob-plus/admob-plus
MIT License
499 stars 214 forks source link

Giving Rewards For Rewad Video Ads. #89

Closed prantikv closed 6 years ago

prantikv commented 6 years ago

Implementing Reward Video Ads I am getting all the events as mentioned here

Namely the following:

admob.rewardvideo.events.LOAD

admob.rewardvideo.events.LOAD_FAIL admob.rewardvideo.events.OPEN admob.rewardvideo.events.CLOSE admob.rewardvideo.events.EXIT_APP admob.rewardvideo.events.START admob.rewardvideo.events.REWARD

But the "REWARD" event is never fired. Moreover, there are no options to setup rewards to give when the user views the ads.

Kindly suggest ways go give rewards/coins/points when the user has viewed the ad. Currently, I am implementing this on the "CLOSE" event.

Thanks.

PS: "REWARD_VIDEO_START" event is not mentioned in the docs but does show up in code.

prantikv commented 6 years ago

The reward does get passes with the "REWARD" event. This works on a live video add and not while testing.

dustinrwh commented 5 years ago

Thanks for posting this. This is how I used it in Ionic:

document.addEventListener('admob.rewardvideo.events.REWARD', (result) => {
    console.log("Received event that reward video was watched");
});
onesynergyti commented 3 years ago

Thanks!

This works for me, but I thing is better use event name string from admobFree object.

document.addEventListener(this.admobFree.events.REWARD_VIDEO_REWARD, (result) => {
      this.points++
    }); 
preetamjakhmola commented 3 years ago

You can use like this with on method.

this.admobFree.on(this.admobFree.events.REWARD_VIDEO_LOAD).subscribe((res)=>{
  console.log("REWARD_VIDEO_LOAD=> ",res);
})

this.admobFree.on(this.admobFree.events.REWARD_VIDEO_REWARD).subscribe((res)=>{
  console.log("REWARD_VIDEO_REWARD=> ",res);
});

this.admobFree.on(this.admobFree.events.REWARD_VIDEO_START).subscribe((res)=>{
  console.log("REWARD_VIDEO_START=> ",res);
})

this.admobFree.on(this.admobFree.events.REWARD_VIDEO_EXIT_APP).subscribe((res)=>{
  console.log("REWARD_VIDEO_EXIT_APP=> ",res);
})

this.admobFree.on(this.admobFree.events.REWARD_VIDEO_CLOSE).subscribe((res)=>{
  console.log("REWARD_VIDEO_CLOSE=> ",res);
})