Am using ionic angular application. I created mobile app using ionic with capacitor. I added status bar in my application using below steps.
Install Statusbar
npm install cordova-plugin-statusbar
npm install @ionic-native/status-bar
ionic cap sync
Code in app.component.ts
import { StatusBar } from '@ionic-native/status-bar/ngx';
constructor(private statusBar: StatusBar) { }
this.platform.ready().then(() => {
this.statusBar.overlaysWebView(true);
this.statusBar.backgroundColorByHexString('#f8d047');
});
When i run my application in Xcode below error occur.
[warn] - Native: tried calling StatusBar.overlaysWebView, but the StatusBar plugin is not installed.
cordova-plugin-statusbar
is not compatible with Capacitor, when you run the sync
command you should see a message telling you that