Ionic StatusBar undefined. Default is coming light -


i trying default statusbar black, it's coming light. when try set black error uncaught referenceerror: statusbar not defined including plugin on https://github.com/apache/cordova-plugin-statusbar.git. removed , added several times, statusbar still light.

cordova-plugin-console 1.0.2 "console" cordova-plugin-device 1.1.1 "device" cordova-plugin-file 4.1.0 "file" cordova-plugin-media 2.1.0 "media" cordova-plugin-splashscreen 3.1.0 "splashscreen" cordova-plugin-statusbar 2.1.0 "statusbar" cordova-plugin-vibration 2.1.0 "vibration" cordova-plugin-whitelist 1.2.1 "whitelist" ionic-plugin-keyboard 1.0.8 "keyboard" 

the code is:

console.log(statusbar); if (window.statusbar) {   // org.apache.cordova.statusbar required   statusbar.styledefault(); } 

you need wait deviceready event able use cordova plugins.

the simplest way wrap code in ionic.platform.ready() call, this:

ionic.platform.ready(function() {   if (window.statusbar) {     // org.apache.cordova.statusbar required     statusbar.styledefault();   } }); 

Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -