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.

  • Building an archive for XCode 4.6 release with phonegap v 2.9 fails
  • How to Open Google Play store from Phonegap
  • Phonegap/Cordova Build error - Apple Mach-O Linker Error: no such file or directory: libCordova.a
  • Phonegap iOS 5.1 and localStorage
  • Minifying code for PhoneGap App?
  • Cordova command-line build fails in /tmp on Mac
  • 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?

    4 Solutions Collect From Internet About “Cordova notification plugin failed installation (Cordova 3.6)”

    @icl1c Your answer didn’t quite work for me, got another error after adding CDVNotification.m to the build phase.

    What I had to do was to add the dependent framework: AudioToolbox.framework as well to make it work.

    enter image description here

    Here is what I did in order to fix this issue.

    In Xcode, you have to add the plugin sources in the build phases.

    1. select your project
    2. select the target of your project
    3. click on the build phases tab
    4. add the missing *.m files
    5. compile

    You can give it a try easily by updating via sudo npm update -g cordova and reverting with your commands if it does not work. Let me know.

    Also if you have still some errors after that, make sure you included all the frameworks required:

    In the same tab (Build phases), you have Link Binary With Libraries (xx items)

    for the contact plugin you need:

    • AddressBook.framework
    • AddressBookUI.framework

    for the camera plugin you need:

    • OpenAL.framewrok
    • ImageIO.framework

    for the notification plugin you need:

    • AudioToolBox.framewrok

    for the device plugin you need:

    • AssetsLibrary.framework

    Cheers

    xcode configuration

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

    sudo npm uninstall cordova -g
    sudo npm install -g cordova@3.5.0-0.2.7
    

    @jBoive answer plus adding below code in config.xml, fixed my issue:

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