capacitor-community / admob

Community plugin for using Google AdMob
MIT License
205 stars 66 forks source link

Rewarded callback function problem #320

Closed justinzhang528 closed 1 month ago

justinzhang528 commented 1 month ago

Here is my code:

const showRewardVideo = async (func: any) => { AdMob.addListener(RewardAdPluginEvents.Rewarded, func) const options: RewardAdOptions = { adId: Rewarded_Id, isTesting: true, } await AdMob.prepareRewardVideoAd(options) }

I use showReardVideo function to show video and exectue func after rewarded, the problem I encountered is that the function I passed in was different every time, but the same function was executed. I've no idea about that. Is there any suggestions for this one, thanks~

distante commented 1 month ago

can you please explain it more? I do not understand what "same function was executed".

justinzhang528 commented 1 month ago

can you please explain it more? I do not understand what "same function was executed".

For example, The first time I call: showRewardVideo(func1());

The second time I call: showRewardVideo(func2());

In this situation, after rewarded and it will only execut func1() although I pass func2() at the second time.

distante commented 1 month ago

There is no showRewardVideo in the plugin API.