/
Android Receive Push Payload Details
Android Receive Push Payload Details
For receiving push events like push received, push opened, push dismissed you need to create on the receiver, which extends PushDataReceiver.
Used in order to receive the payload of the notification:
public class MyPushBroadcastReceiver extends PushDataReceiver {
@Override
public void onPushReceived(PushData pushData) {
Log.d("Engage", "Push received " + pushData);
}
@Override
public void onPushOpened(PushData pushData) {
Log.d("APX", "Push opened " + pushData);
}
@Override
public void onPushDismissed(PushData pushData) {
Log.d("APX", "Push dismissed " + pushData);
}
@Override
public void onSilentPush(PushData pushData) {
Log.d("APX", "Push Silent " + pushData);
}
@Override
public void onButtonClick(PushData pushData, String buttonAction, int buttonPosition) {
Log.d("APX", "Button clicked: " + pushData);
}
} |
In AplicationManifest within application tag you should add:
<receiver
android:name=".MyPushBroadcastReceiver"
android:enabled="true"
android:exported="false">
<intent-filter>
<action android:name="com.appoxee.PUSH_OPENED" />
<action android:name="com.appoxee.PUSH_RECEIVED" />
<action android:name="com.appoxee.PUSH_DISMISSED" />
<action android:name="com.appoxee.BUTTON_CLICKED" />
<category android:name="${applicationId}" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</receiver> |