Capacitor status bar style change with light/dark theme

I’m developing an iOS Ionic app with Capacitor that uses a black or white Status Bar background color, depending if the device is on Light or Dark theme. By default the app changes the Status Bar style automatically according to the theme, so if the background is black I see white content (battery icon etc.) and if the background is white then I see black content. However if I use anywhere in the code:

StatusBar.setStyle({ style: StatusBarStyle.Dark });

The Status Bar style stops changing automatically. Is there a way of having this behavior back? Thanks for your comments.

The default value of the Status bar is default, which on iOS 13+ is theme dependent, but at the moment, if you change the value to dark or Light it’s not possible to set it to default again.

In Capacitor 3 the plugins have been moved out to their independent packages and the new @capacitor/status-bar plugin has a new Default configuration option that will allow you to set the value back. Sadly it only works with Capacitor 3, which is still in alpha stage.

Thanks for the detailed answer, keep up the good work.