Search code examples
iosxcodecordovacordova-plugins

Cordova notification plugin failed installation (Cordova 3.6)


I've updated a project from Cordova 3.4 to 3.6.3 and everything has fallen apart (as usual).

But specifically, here, the org.apache.cordova.dialogs plugin is not working in runtime on ios.

Cordova says the plugin is installed:

$ cordova plugins ls
org.apache.cordova.dialogs 0.2.9 "Notification"
org.apache.cordova.vibration 0.3.10 "Vibration"

In config.xml (the one outside of the platforms directory) I have added:

<feature name="Notification">
  <param name="ios-package" value="CDVNotification" />
</feature>

When, in JavaScript, I try to create an alert like this (and yes device is ready):

navigator.notification.alert("Test alert", null);

I get this error thrown in the XCode debugger (I added line breaks for legibility)

2014-09-18 15:03:26.327 Milk[3045:60b] 
CDVPlugin class CDVNotification (pluginName: Notification) does not exist.
2014-09-18 15:03:26.328 Milk[3045:60b] 
ERROR: Plugin 'Notification' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
2014-09-18 15:03:26.329 Milk[3045:60b] 
-[CDVCommandQueue executePending] [Line 158] FAILED pluginJSON = [
  "INVALID",
  "Notification",
  "alert",
  [
    "Test alert",
    "Alert",
    "OK"
  ]
]

I have tried cordova plugin rm / cordova plugin add and also running cordova platform rm to add and remove ios.

So: "CDVPlugin class CDVNotification (pluginName: Notification) does not exist."?

Cordova says it's installed, how can I solve this?


Solution

  • I globally downgraded to Cordova 3.5 and now it seems OK.

    sudo npm uninstall cordova -g
    sudo npm install -g [email protected]