1
votes

I'm using Parse Push notification, after the quick start guide, my app can now receive push notification.

Here's the problem, just like Facebook, I want to control the notification sent by Parse, I want to add IF statement before showing the notification.

Example, when I send a push message, everyone will receive this message, then there's an IF statement with data from sharedpreferences, the sharedpref saved "Gender" and in the IF statement, IF (push = "male") then show notification message. else do not show notification message.

How can I do that?

2

2 Answers

0
votes

If you wanna do that, you have to buy the premium membership in parse.com. Then, go to dashboard/push notification/new message... and you can choose the parameters to send the push notifications

0
votes

(1) When you want to control from Parse website UI :

You can add filter in Parse.com account and send notification to restricted application installs which satisfy your criteria

enter image description here

(2) When you want to control from Application side :

We need to extend ParsePushReceiver class and make our custom receiver. We also need to override onPushReceive() method which will get call when any parse notification arrives to our application. From this callback, we can control whether to show notification, whether to process in background etc based on application need

Thank you