Closed birdofpreyru closed 7 months ago
All I know about "Activity" in react-native is that it can be null, you can never be sure that the Activity wasn't destroyed even though your code is still executing because of the async nature of the native/javascript bridge (which is Application-scoped if I understand correctly - while the Activity can come and go)
So this is kind of a fundamental mismatch between what mediation needs and how react-native works. I'm not sure how to harmonize them, all I know for certain is that your Activity can become invalid / null when you least expect it and that needs to be handled
Hello 👋, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.
Thanks @github-actions , but let's keep it open for now.
Hello 👋, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.
not stale
:tada: This issue has been resolved in version 12.11.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
What happened?
Below (and, if applicable, in other similar places in the Android code, where ad objects are created): https://github.com/invertase/react-native-google-mobile-ads/blob/c0c3df6874033b98b6d7ba71643b486af394a9b4/android/src/main/java/io/invertase/googlemobileads/ReactNativeGoogleMobileAdsBannerAdViewManager.java#L182
An
Activity
instance rather thanContext
should be passed into theAdView
constructor, as per AdMob Mediation instructionsP.S.: I guess, I can make a PR later. Though looking at the existing code just above, where it checks whether
currentActivity
might benull
, but does not check for the context to benull
, I'd like to check with @dylancom first, if he knows whether it is possible that the current activity is indeed null at that point? If yes, what would be better, to returnnull
if it isnull
, or just init with context instead, as a fallback?Platforms
Only on Android
React Native Info
Are your using Typescript?
package.json
app.json
ios/Podfile
No response
android/build.gradle
No response
android/app/build.gradle
No response
android/settings.gradle
No response
AndroidManifest.xml
No response