I need help implementing a ParsePushBroadcastReceiver, in order to use it to parse a JSON Object, to choose an Activity to start.
I've tried with:
<receiver
android:name="com......BroadcastReceiver"
android:exported="false">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.DELETE" />
<action android:name="com.parse.push.intent.OPEN" />
</intent-filter>
</receiver>
Or
<receiver android:name="com....BroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
But no success...
My application class
public class AppApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
System.out.println("vrum");
Parse.initialize(this, "...", "..");
PushService.setDefaultPushCallback(this, HomeActivity.class);
ParseInstallation.getCurrentInstallation().saveInBackground();
}
When I click the notification I get to the HomeActivity...same thing if I remove that line
PushService.setDefaultPushCallback(this, HomeActivity.class);
ParseBroadcastReceiverPushService.setDefaultPushCallback(this, HomeActivity.class);if(intent.hasExtra("com.parse.Data")) { try { json = new JSONObject(intent.getExtras().getString("com.parse.Data"));then show notification and on click you can navigate to a different activity