Q:

PushPlugin not found in iOS application using cordova

I am trying to use the PushPlugin to develop an iOS application. I am facing the following error:
DEPRECATION NOTICE: The Connection ReachableViaWWAN return value of '2g' is deprecated as of Cordova version 2.6.0 and will be changed to 'cellular' in a future release. 

2013-12-23 17:19:52.362 myApp[537:60b] CDVPlugin class PushPlugin (pluginName: PushPlugin) does not exist.

2013-12-23 17:19:52.363 miniOrangeAuthenticator[537:60b] ERROR: Plugin 'PushPlugin' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.

2013-12-23 17:19:52.364 miniOrangeAuthenticator[537:60b] -[CDVCommandQueue executePending] [Line 116] FAILED pluginJSON = [

  "PushPlugin1458195152",

  "PushPlugin",

  "register",

  [

    {

      "alert" : "true",

      "ecb" : "onNotificationAPN",

      "sound" : "true",

      "badge" : "true"

    }

  ]

]

I have added the dependency in the config.xml file as follows:
<feature>
    <param name="ios-package" value="PushPlugin" />
</feature>

i also tried the old plugins format with the following code:
<plugin name="PushPlugin" value="com.phonegap.plugins.PushPlugin" />

Even that gave me the same error.
I am trying on a real iOS device.
what may be the issue here?

A:

Which version of cordova are you using?
I installed that plugin with cordova 2.9 and I remember that I had some problem importing the files in xcode. 
If you are using cordova 3.x on iOS you just have to add the plugin via command line (on android you have also to manually copy a file, but on iOS it's not necessary).
EDIT to answer the question in the comment: the only thing I can think of is that you initialize the plugin before the "device ready" event is fired. This is the code I use:
var initPushNotification = function() {
    var pushNotification = window.plugins.pushNotification;
    pushNotification.register(
        tokenHandler,
        errorHandler, {
            "badge":"true",
            "sound":"true",
            "alert":"true",
            "ecb":"onNotificationAPN"
        });
};

function onDeviceReady() {
    // other stuff here...
    initPushNotification();
}

