Parse Push Notification with Phonegap Android provides a great service to setup push notification for your android/iphone apps, features for which can be seen here

We will see in this blog post how to integrate parse push notification with phonegap for your android application.

Before starting you need to first create an account on and generate application app_id and client_key.
Next install the phoengap module at
This plugin uses a newer version of parse library which used Google GCM and Parse Broadcast Receiver.

To install run this command

cordova plugin install

After the plugin gets installed, run “cordova build android” too see if the build completes successfully.
You may get an error like this

" Multiple dex files define Lbolts/AggregateException;"

The reason for this might be your using facebook android library in your app which has the “bolts-android” library and the current parse plugin also has the same library. To fix this error, open folder “platforms\android\libs” and remove the “bolts-android” jar file.

Next step, is to add Parse.initialize code. For this go to directory “platforms\android\src\com\package\app” and create a file Write this code

package; //replace with your package name

import org.apache.cordova.*;
import com.parse.Parse;
import com.parse.ParseAnalytics;
import com.parse.ParseInstallation;
import com.parse.PushService;
import com.parse.ParsePush;
import com.parse.ParseCrashReporting;

//// Track app opens.
// in cordova activty
public class MainApplication extends Application {

    public void onCreate() {
      ParseCrashReporting.enable(getApplicationContext()); //this only if you want to use crash reporting
      Parse.initialize(this, "app_id", "client_key");
      PushService.setDefaultPushCallback(this, CordovaApp.class);
      ParsePush.subscribeInBackground("Broadcast"); // if you want all app users to subscribe to a channel

Open your file and put in line “ParseAnalytics.trackAppOpened(getIntent());” in the onCreate method. Also don’t forgot to get add “import com.parse.ParseAnalytics;” in your file.

Now open “AndroidManifest.xml” located in “platforms/android” find the “application” tag and add “android:name=”” as attribute to the application tag.

Run your app using

If you get error link

error: cannot access Task

this means the bolts library is missing from android/platform/libs

cordova run android

At this point, if you send push notification from parse your app should receive it.

To be able to receive notification inside your phonegap application use code

    appId:"PARSE_APPID", clientKey:"PARSE_CLIENT_KEY", eventKey:"myEventKey"},
    function() {
        alert('successfully registered device!');
    }, function(e) {
        alert('error registering device: ' + e);

ParsePushPlugin.on('receivePN', function(pn){
        alert('yo i got this push notification:' + JSON.stringify(pn));

Following above steps, you should be able to successfully start receiving notification from parse.