Created
February 27, 2015 12:21
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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