I have set up parse push notifications and I had my app crash when I tried to open it, now I found a work around my making a new java class and overriding onPushOpen
like this:
public class Receiver extends ParsePushBroadcastReceiver {
@Override
public void onPushOpen(Context context, Intent intent) {
Intent i = new Intent(context, MainActivity.class);
i.putExtras(intent.getExtras());
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
}
}
But in order to still receive push notifications I still need this depreciated method in my MyApplication.java class PushService.setDefaultPushCallback(this, MainActivity.class);
How could I get rid of this depreciated method I have looked at this question where I got some help but it did not answer this part about the depreciated method. Exception when opening Parse push notification.
I was thinking that maybe this method could be over ridden but Im not sure if it acutely handles recvieving the push or more handles the push after it has been received?
@Override
public void onPushReceive(final Context c, Intent i) {
// Handle the received push
}
Thanks for the help in advance.