The problem is that device
is not ready never under ios emulator.
Cordova's Device plugin initializes properly the object device
, but device.ready
is always false, plus all fields being null. That means that the plugin is not being initialized, and also deviceready
event does not fire, and also does not work using the $ionicPlatform.ready(...)
method (Properly imported, with ['ionic']
dependency and injected into the controller using ["$ionicPlatform", function($ionicPlatform)]
).
So far, I have tried rebuilding several times, adding the plugin several times, ionic prepare
and more things, but nothing works.
In the XCode's output I get the following error:
2016-09-27 11:55:15.738 MyApp[74125:12496643] ERROR: Plugin 'Device' not found, or is not a CDVPlugin. Chech your plugin mapping in config.xml.
2016-09-27 11:55:15.738 MyApp[74125:12496643] -[CDVCommandQueue executePending] [Line 142] FAILED pluginJSON = ["Device330720986", "Device", "getDeviceInfo", []]
2016-09-27 11:55:15.738 MyApp[74125:12496643] ERROR: Plugin 'StatusBar' not found, or is not a CDVPlugin. Chech your plugin mapping in config.xml.
2016-09-27 11:55:15.738 MyApp[74125:12496643] -[CDVCommandQueue executePending] [Line 142] FAILED pluginJSON = ["StatusBar330720987", "StatusBar", "_ready", []]
I suspect that this last _ready
has something to do with the deviceready
not being triggered.
Under Android has been tested and works pretty well. Also under Ripple gives a good response.
So, what do you think that could be the problem? I have been wandering arround stack overflow and other places on the internet and I haven't seen any result trying common solutions.
Feel free to ask me for more data.
I had this once (here) - It wasn't pretty but I resolved it by doing:
cordova platform remove ios
and then (you guessed it)...
cordova platform add ios