use the given Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="your package name"
android:versionCode="3"
android:versionName="1.1" >
<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="13" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.QUICKBOOT_POWERON" />
<uses-permission android:name="android.permission.VIBRATE" />
<application
android:name="com.test.param.mainActivity"
android:allowBackup="true"
android:icon="@drawable/menu"
android:label="@string/app_name"
android:theme="@style/AppTheme"
>
<activity
android:name="Splash"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.test.param..Profile"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan"
>
</activity>
<activity
android:name="com.test.param.AnnounceActivity"
android:screenOrientation="portrait"
android:label="@string/app_name"
>
</activity>
<activity
android:name="com.test.param.MenuActivity"
android:screenOrientation="portrait" >
</activity>
>
</activity>
<activity
android:name="com.test.param.ShowPopUp"
android:screenOrientation="portrait"
android:label="@string/app_name"
android:theme="@android:style/Theme.Holo.Light.Dialog"
>
</activity>
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.RECEIVE_BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<action android:name="android.intent.action.USER_PRESENT" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<receiver android:name="com.test.param.MyCustomReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
<action android:name="android.intent.action.RECEIVE_BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<action android:name="com.test.param.UPDATE_STATUS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
</application>
</manifest>
----------
use this to send the push notification
JSONObject obj;
try {
obj = new JSONObject();
obj.put("alert", "hello");
obj.put("action", "*Your main package name*.UPDATE_STATUS");
obj.put("title", "param");
obj.put("msg", "Today meeting is at 9 AM ");
obj.put("time", CurrentDate.getCurrentDate());
ParsePush push = new ParsePush();
@SuppressWarnings("rawtypes")
ParseQuery query = ParseInstallation.getQuery();
// Notification for Android users
query.whereEqualTo("deviceType", "android");
push.setQuery(query);
push.setData(obj);
push.sendInBackground();
} catch (JSONException e) {
e.printStackTrace();
}
use it as a Custom receiver class.....
public class MyCustomReceiver extends BroadcastReceiver {
String title, time,msg;
@Override
public void onReceive(Context context, Intent intent) {
Bundle extras = intent.getExtras();
String message = extras != null ? extras.getString("com.parse.Data")
: "";
Log.e("message ", " " + message);
JSONObject jObject;
try {
if (message != null && !message.equals("")) {
jObject = new JSONObject(message);
time = jObject.getString("time");
msg = jObject.getString("title");
title = jObject.getString("msg");
}
}
catch (JSONException e) {
e.printStackTrace();
}
}
}
----------
and dont remove the DefaultPushCallback
i have successfully implemented and it's working very fine