$ionicPlatform ready is not firing on my iPhone


#1

Hi guys, here’s the code

$ionicPlatform.ready(function() {
        alert('Platform is ready!');
        console.log('platform is ready', $scope.loading);
        if ($scope.loading) {
            $scope.refreshPositionFeed();
        }
    });

Nothing gets fired. Everything works fine on the browser.

The console.log outputs the following:

2014-06-20 15:36:54.244 CornetaRIO[49843:70b] CDVPlugin class CDVSDevice (pluginName: Device) does not exist.
2014-06-20 15:36:54.245 CornetaRIO[49843:70b] ERROR: Plugin 'Device' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
2014-06-20 15:36:54.245 CornetaRIO[49843:70b] -[CDVCommandQueue executePending] [Line 158] FAILED pluginJSON = [
 "Device340399115",
 "Device",
 "getDeviceInfo",
 [

 ]
]

Any ideas?


#2

Hey there! Was this a project created via our CLI? Do you have the cordova device plugin installed?


#3

Hi! Yes, it was created by ionics cli. And yes, it is installed.

"installed_plugins": {
    "com.ionic.keyboard": {
        "PACKAGE_NAME": "com.ionicframework.starter"
    },
    "org.apache.cordova.camera": {
        "PACKAGE_NAME": "com.ionicframework.starter"
    },
    "org.apache.cordova.console": {
        "PACKAGE_NAME": "com.ionicframework.starter"
    },
    "org.apache.cordova.device": {
        "PACKAGE_NAME": "com.ionicframework.starter"
    },
    "org.apache.cordova.geolocation": {
        "PACKAGE_NAME": "com.ionicframework.starter"
    }
}

This is my plugins/ios.json and there is a plugins/org.apache.cordova.device folder.


#4

Is this file correct? main config.xml

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.ionicframework.starter" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>CornetaRIO</name>
<description>
    An Ionic Framework and Cordova project.
</description>
<author email="hi@ionicframework" href="http://ionicframework.com/">
  Ionic Framework Team
</author>
<content src="index.html" />
<access origin="*" />
<preference name="fullscreen" value="true" />
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<!-- Don't store local date in an iCloud backup. Turn this to "cloud" to enable storage
     to be sent to iCloud. Note: enabling this could result in Apple rejecting your app.
-->
<preference name="BackupWebStorage" value="none" />

<feature name="StatusBar">
  <param name="ios-package" value="CDVStatusBar" onload="true" />
</feature>

<feature name="Geolocation">
    <param name="android-package" value="org.apache.cordova.GeoBroker" />
    <param name="ios-package" value="CDVLocation" />
</feature>

<feature name="Camera">
    <param name="ios-package" value="CDVCamera" />
</feature>

#5

Problem solved.

I’ve deleted all my builds and rebuilt everything


#6

Hey sorry for not getting back to you! Glad to see you got it resolved!