Skip to content

Instantly share code, notes, and snippets.

@panchicore
Created February 27, 2015 12:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save panchicore/97d5ad25842258576109 to your computer and use it in GitHub Desktop.
Save panchicore/97d5ad25842258576109 to your computer and use it in GitHub Desktop.
Make sure you've gone through the Android Push QuickStart to set up your app to receive pushes. https://www.parse.com/apps/quickstart#parse_push/android/existing
package com.foobar.notification;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import com.parse.ParseAnalytics;
import com.parse.ParsePushBroadcastReceiver;
public class Receiver extends ParsePushBroadcastReceiver {
private static final String TAG = "PUSH";
@Override
public void onPushOpen(Context context, Intent intent) {
ParseAnalytics.trackAppOpenedInBackground(intent);
Log.i(TAG, "onPushOpen " + intent.getExtras().getString("com.parse.Data"));
}
@Override
public void onReceive(Context context, Intent intent) {
Log.i(TAG, "onReceive " + intent.getExtras().getString("com.parse.Data"));
super.onReceive(context, intent);
}
@Override
protected void onPushReceive(Context context, Intent intent) {
Log.i(TAG, "onPushReceive " + intent.getExtras().getString("com.parse.Data"));
super.onPushReceive(context, intent);
}
@Override
protected void onPushDismiss(Context context, Intent intent) {
Log.i(TAG, "onPushDismiss " + intent.getExtras().getString("com.parse.Data"));
super.onPushDismiss(context, intent);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment