Getting error in PushNotifications.java while adding a plugin in phonegap android project

Answered

Comments

6 comments

  • Avatar
    Max Konev

    Hi,

    Which version of Cordova do you use? Before 3.0 the import used to be:

     import org.apache.cordova.api.CallbackContext;
    

    Please note .api art in the import.

    After Cordova 3.0 the namespace has been changed and became as it is now:

     import org.apache.cordova.CallbackContext;
    

    If you are using Cordova < 3.0 it might be very good idea to upgrade to the latest version.

  • Avatar
    intellectlogic

    Hi

    thanks for reply and by adding .api in import has helped and now the error is not there at least in eclipse and it executes, but when it now gives error of Fail to register: class not found..

    can you help..please

  • Avatar
    Max Konev

    It looks like you miss these lines in your config.xml:

    For Cordova < 3.0:
    <plugin name="PushNotifications" value="com.pushwoosh.plugin.pushnotifications.PushNotifications" onload="true"/>

    (Just FYI) For Cordova 3.0 and above these lines looks a bit different with the same meaning:

    <feature name="PushNotification">
    <param name="android-package" value="com.pushwoosh.plugin.pushnotifications.PushNotifications"/>
    </feature>

  • Avatar
    intellectlogic

    hi

    thank you so much for all your help, now my app is taking token and runs without error, but when i see from pushwoosh control panel i dont see any subscriber registered and hence even after creating push notification its not getting delivered.

    Any guide for this problem

  • Avatar
    Max Konev

    Do you have any logs from the console? Do you have App ID entered correctly in registerDevice call?

  • Avatar
    Max Konev

    Please don't forget to mark correct answer as "accepted". Thanks!

Please sign in to leave a comment.