Closed zoobibackups closed 1 month ago
Using React techniques, changing the key
property of the banner component when the app comes into foreground should do the job. You can detect whether the app came into the foreground using the React Native AppState
API.
Why would you want this? A banner ad is refreshing itself automatically after Google's recommendations (30sec?). But indeed possible as DoctorJohn suggested.
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.
I just found out this actually makes a lot of sense. Apparently the OS can terminate WKWebView when the app is in a "suspended" state. Which can lead to blank ads upon reopening the ad. See: https://groups.google.com/g/google-admob-ads-sdk/c/rwBpqOUr8m8
Current advise by Google is to request a new ad when the app is foregrounded.
For a smoother experience, I added a reload method. This prevents flickering that occurs if we would just update the key prop. Would be great if someone could test / provide feedback: https://github.com/invertase/react-native-google-mobile-ads/pull/579
What happened?
I want to reload banner ads when ever app the come to forground
Platforms
Android and iOS
React Native Info
Are your using Typescript?
package.json
app.json
ios/Podfile
android/build.gradle
android/app/build.gradle
android/settings.gradle
AndroidManifest.xml