views:

380

answers:

2

Hi Guys, I am successfully fetching Apple APNS feedback data via PHP. The structure that I am getting (after some processing) looks something like this:

timestamp

device token

My question is how to know which of the device tokens should I remove from my database and stop sending notifications to them.

Regardz,

Mladjo

A: 

All devices given by feedback are 'failed' and should be removed. No feedback means no devices should be removed. It's covered over on the Apple Documentation:

Apple APN Documentation

Lee
APNS feedback returns device tokens if the notification delivery has failed. This doesn't mean that the application has been uninstalled from the device, it can just be that the user doesn't have persistant wifi connection at the moment.
Mladen
That is not what the documentation says."If a provider attempts to deliver a push notification to an application, but the application no longer exists on the device, the device reports that fact to Apple Push Notification Service. This situation often happens when the user has uninstalled the application. If a device reports failed-delivery attempts for an application, APNs needs some way to inform the provider so that it can refrain from sending notifications to that device."
Lee
A: 

You should store devices with their device token data, and then you can find these devices according to their device tokens. You might use device token for identifier each device. Than would be easy to find and change their statuses into your db.

fyasar