invertase / react-native-google-mobile-ads

React Native Google Mobile Ads enables you to monetize your app with AdMob.
https://docs.page/invertase/react-native-google-mobile-ads
Other
686 stars 139 forks source link

🔥 [🐛] RNGoogleMobileAdsExample Status bar could not be hidden for full screen ad #136

Closed puckey closed 1 year ago

puckey commented 2 years ago

Issue

When I display an Interstitial in the iOS RNGoogleMobileAdsExample example app on my phone (iPhone SE), I see the following warning in the output:

2022-05-09 14:32:51.757814+0200 RNGoogleMobileAdsExample[480:45469] Status bar could not be hidden for full screen ad. Ensure that your app is configured to allow full screen ads to control the status bar. For example, consider whether you need to set the childViewControllerForStatusBarHidden property on your ad's rootViewController.

In the past I have had issues where users were unable to close interstitials due to the close button being under the status bar. Might this be related to this warning?


Project Files

Javascript

Click To Expand

#### `package.json`: ```json # N/A ``` #### `admob.json`: ```json # N/A ```

iOS

Click To Expand

#### `ios/Podfile`: ```ruby # N/A ``` --- ### Android

Click To Expand

#### `android/build.gradle`: ```groovy // N/A ``` #### `android/app/build.gradle`: ```groovy // N/A ``` #### `android/settings.gradle`: ```groovy // N/A ``` #### `AndroidManifest.xml`: ```xml ```

--- ## Environment
Click To Expand

**`react-native info` output:** ``` OUTPUT GOES HERE ``` - **Platform that you're experiencing the issue on**: - [ ] iOS - [ ] Android - [ ] **iOS** but have not tested behavior on Android - [ ] **Android** but have not tested behavior on iOS - [ ] Both - **Are you using `TypeScript`?** - `Y/N` & `VERSION`

--- - 👉 Check out [`Invertase`](https://twitter.com/invertaseio) on Twitter for updates on the library.
mikehardy commented 2 years ago

Sorry for being silent on this one until now - I appreciate the report and it appears it needs triage

parasdaryanani commented 2 years ago

I'm seeing this warning in the console as well. Until there's a more permanent fix I'm using a workaround by toggling the status bar as follows:

import { StatusBar } from 'react-native';

...

const MyScreen = () => {

  const { isLoaded, isClosed, isEarnedReward, reward, load, show } =
    useRewardedAd(adUnitId, {
      requestNonPersonalizedAdsOnly: true,
      keywords: ["fashion", "clothing"],
    });

  useEffect(() => {
    if (isClosed) {
      StatusBar.setHidden(false);
      navigation.navigate("CompletionScreen");
    }
  }, [isClosed, navigation]);

  const handleShowAd = () => {
    StatusBar.setHidden(true);
    show();
  };

};
bitfabrikken commented 2 years ago

Edit: After further diving into this today, my comment does not appear related to this issue with the status bar. Applying the fix from @parasdaryanani did not alleviate, so I'll create a new issue for it.

@mikehardy This is a quite serious bug - if a specific interstitial is shown on some devices, the app is useless because the user cannot close the ad.

Been seeing this too - but not the warning since it's happening on a live app. People have been complaining they can't close the interstitial ad on some devices.

Today I tested on 30+ devices on stackoverflow, and it only happened in these cases:

I could close the ad by clicking pixel-perfectly on the absolute bottom of the button, indicating something is blocking the clicks. There's only maybe 1-4 pixels in the height which reacts to the click.

Of course this wonderful issue doesn't occur in Simulators, as these can't seem to show non-test ads, which don't have this particular type of interstitial. And they also only happen for very few specific devices, and on top of that, only for some specific ads - which for some only happen a couple times a day.

Other devices this did NOT appear on - i.e. no issues:

Edit - To reproduce:

github-actions[bot] commented 1 year ago

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.

mikehardy commented 1 year ago

needs triage for anyone whose business is affected...

github-actions[bot] commented 1 year ago

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.