-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(admob): AdEventHandler returns javascript (not native) unsubscribe function #4920
Conversation
`_setAdEventHandler` method return a wrong unsubscribe function. It should remove js listener, but instead it unsubscribe ad instance from native events and _onAdEventHandler is still could be used by the instance
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/invertase/react-native-firebase/glnr6112b |
Codecov Report
@@ Coverage Diff @@
## master #4920 +/- ##
==========================================
+ Coverage 88.50% 88.93% +0.43%
==========================================
Files 109 109
Lines 3721 3721
Branches 348 348
==========================================
+ Hits 3293 3309 +16
+ Misses 385 369 -16
Partials 43 43 |
Thanks for posting this! I just tagged it for review - only 3 items in the queue, hope to get to this quickly and either just merge or work with you to get it merged and released. Cheers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your patience! I do not use admob personally but the problem as you describe it, the code I see plus your change make sense, and it seems reasonable. I'll merge it and it will be in the next release which should be today or tomorrow - either 10.8.1 or 10.9 depending on what else gets merged
Releasing as 10.8.1 right now, thanks! |
_setAdEventHandler
method return a wrong unsubscribe function. It should remove js listener, but instead it unsubscribe ad instance from native events and _onAdEventHandler is still could be used by the instanceDescription
RewardedAd instance onAdEvent method uses _setAdEventHandler of it's superclass. Logically it should return function that will unsubscribe listener that we add, but instead it unsubscribe instance from native events.
Related issues
It's not possible to use different listeners for load and show ad because after first unsubscribe ad intance doesn't receive any native events anymore
When we call loadAd on app start and then we want to call showAd at some moment it won't receive any native events
Release Summary
Checklist
Android
iOS
e2e
tests added or updated inpackages/\*\*/e2e
jest
tests added or updated inpackages/\*\*/__tests__