tags:

views:

89

answers:

1

I got APNS working perfectly, after many issues with SSL.

Now, I was wondering how I can filter the notifications sent to the devices. I have to do it server-side, or client-side (app) ?

For example, a Soccer app that sends the latest game scores to the registered devices. By default, my device shows all notifications sent by APNS (all scores). What if I want to receive only Real Madrid scores, because I'm a Real Madrid fan?

I keep APNS sending all scores, and I implement the filter in client, or I have to filter in the server side, sending specific payloads to specific devices?

+1  A: 

Definitely the server side. Apple specifically state that sending large numbers of notifications to devices that don't want to receive them (either not relevant, or push not enabled etc) - is a bad practice.

Not to mention - if your volume picks up in terms of userbase, you don't want to flatline your link.

Chaos
Yes, you're right. Makes sense.But how to do it ? How to send additional info with the device token to APNs at registration time ?
I use an XML based protocol I invented for the iPhone app SuperSwap - I create a User record with the device ID - and the types of notifications they want to receive (text/pictures/replies/etc) - and then my server looks at this information before dispatching the notification to apple's servers.
Chaos