Hide/Show status bar Android/iOS on Runtime

I tried to use

UnityEditor.PlayerSettings.statusBarHidden = true;

but not working cuz it’s a UnityEditor namespace which does not allow Android build

is there any other way to access the status bar thing
for both Android and iOS

even Rather than writing a plugin, please ??

Take a look at this repo: GitHub - HuaYe1975/UnityStatusBarForiOS: Unity plugin for ios to show/hide status bar

They somehow override functionality from #include “UnityViewControllerBaseiOS.h” if I got it right.
Tested it with iOS 11, Unity 5.6.4p4 and Xcode9 and it works like a charm with that setup. If you use Unity 2017 or higher you will need to replace
#include “UnityViewControllerBaseiOS.h”
with
#include “UnityViewControllerBase.h”
in StatusBarViewController.mm.

create class in xcode and paste following code. than use it in unity project

#import "StatusBar.h"

@implementation StatusBar
  + (void) hideStatusBar: (BOOL)hide
    {
        [[UIApplication sharedApplication] setStatusBarHidden: hide
                                                withAnimation: UIStatusBarAnimationSlide];
        [UnityGetGLViewController() setNeedsStatusBarAppearanceUpdate];
    }
    
    @end
    
    extern "C"
    {
        void StatusBarSwitcherPressed(bool isHide)
        {
            [StatusBar hideStatusBar: isHide];
        }
    }

Hi guys,

I made a asset for this, it is possible to have a toggleable full screen mode.

Mobile Status & Navigation bar