question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Status bar could not be hidden for full screen ad on IOS devices

See original GitHub issue

2.0.1

When I use Interstatial ads on iOS devices I receive this warning in debug console.(No problems with ads showing) 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. I wasn’t able find out where can I implement the hide status bar functionality. Can you help?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
cristian1980commented, Sep 19, 2022

@minhdanh SystemChrome.setEnabledSystemUIMode() is asynchronous, use await SystemChrome.setEnabledSystemUIMode() to make sure the bars are actually hidden before the ad is displayed.

0reactions
minhdanhcommented, Sep 13, 2022

@JoeArmani @zumatrahia How do you restore the status bar when the ad is closed? I tried but it doesn’t work. I’m not sure how. Here’s my code:

              SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []);
              await _showInterstitialAd();
              SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: SystemUiOverlay.values);
              print('Ad has been displayed');

Even when I await the _showInterstialAd function, the line ‘Ad has been displayed’ always printed before the ad finished. Meaning somehow the async function showInterstialAd doesn’t wait at all.

Here’s the code of _showInterstitialAd():

  Future<void> _showInterstitialAd() async {
    if (_interstitialAd != null) {
      _interstitialAd!.fullScreenContentCallback = FullScreenContentCallback(
        onAdDismissedFullScreenContent: (InterstitialAd ad) {
          ad.dispose();
          _loadInterstitialAd();
        },
        onAdFailedToShowFullScreenContent: (InterstitialAd ad, AdError error) {
          ad.dispose();
          _loadInterstitialAd();
        },
      );
      await _interstitialAd!.show();
    }
  }
Read more comments on GitHub >

github_iconTop Results From Across the Web

status bar hidden in modal view (over fullscreen presentation)
First go to plist and check if View controller-based status bar appearance is set to YES and set prefersStatusBarHidden() which you've tried. – ......
Read more >
SDK migration | Mobile Ads SDK for iOS - Google Developers
Starting from version 9.0.0, when you present full screen format ads, your app should ensure that the ads are able to control the...
Read more >
Fix Status Bar Missing in Full Screen Apps When Using Stage ...
Not sure if anyone noticed but with Stage Manager enabled, sometimes the status bar just doesn't show up in full screen apps.
Read more >
Hide StatusBar on iOS 13.5 | Apple Developer Forums
In the info.plist I added "UIStatusBarHidden = YES"; It immediately changes to "Status bar is initially hidden = YES" and works for the...
Read more >
Hide system bars for immersive mode - Android Developers
... fullscreen without any indicators on the status bar or the navigation bar. ... shows how you can engage users more deeply with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found