Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate StatusBar.styleDefault or document iOS 13 behaviour #165

Closed
jcesarmobile opened this issue Oct 22, 2019 · 7 comments
Closed

Deprecate StatusBar.styleDefault or document iOS 13 behaviour #165

jcesarmobile opened this issue Oct 22, 2019 · 7 comments

Comments

@jcesarmobile
Copy link
Member

styleDefault no longer sets the text to black, instead it depends on the device mode set on the device.
If device is set to dark mode, default set the text to white.

So we should deprecate it or document this new iOS 13 behaviour.

@forumics
Copy link

edit CDVStatusBar.m
look for this line:

  • (void) styleDefault:(CDVInvokedUrlCommand*)command

replace the whole method with

  • (void) styleDefault:(CDVInvokedUrlCommand*)command
    {
    if (@available(iOS 13.0, *)) {
    [self setStyleForStatusBar:UIStatusBarStyleDarkContent];
    } else {
    [self setStyleForStatusBar:UIStatusBarStyleDefault];
    }
    }

@jcesarmobile
Copy link
Member Author

Default should be the native default and we should add styleDark

#164

@rml125
Copy link

rml125 commented Oct 31, 2019

edit CDVStatusBar.m
look for this line:

  • (void) styleDefault:(CDVInvokedUrlCommand*)command

replace the whole method with

  • (void) styleDefault:(CDVInvokedUrlCommand*)command
    {
    if (@available(iOS 13.0, *)) {
    [self setStyleForStatusBar:UIStatusBarStyleDarkContent];
    } else {
    [self setStyleForStatusBar:UIStatusBarStyleDefault];
    }
    }

WoooW! I had the same problem. This fix worked perfectly.

@jcesarmobile
Copy link
Member Author

Please, don't comment things out of topic.

The issue is about deprecating styleDefault because the name is confusing (default value of statusbar is lightContent).
Or documenting the iOS 13 behaviour (i.e. default depends on the device mode, dark mode -> white, light mode -> black)
Or just make it always set the text to black as it used to, but in that case I think it would be better to add a new method styleDark and deprecate/remove the default one.

@forumics
Copy link

forumics commented Nov 5, 2019

when i have the time, i will create a fork and implement your suggestion

@danielehrhardt
Copy link

when i have the time, i will create a fork and implement your suggestion

https://github.com/codextde/cordova-plugin-statusbar-color-fix

@jcesarmobile
Copy link
Member Author

closing since looks like people wants default to be black as it used to instead of native default.
That behavior has been fixed in #169

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants