4

I am wondering if when you get a list of tokens back from apple's push feedback service, are these specific to only the app that made the call (using that app's pem certificate), or will apple send you back the tokens for all your apps that have app id's under the same account?

The reason I ask, is that I have a script which checks feedback service so it can remove the tokens before sending a push. I copied the script and set it up in a new sub-directory for my new app, and changed all the appropriate database info and created the new pem files for this new app.

As this is a new app there is only one token in the database and I have not sent any push yet, but when I ran the script, the feedback service reported 1200 tokens that needed to be removed. Since I was not expecting this, I was only checking to remove those tokens from the database for this one app, and not from the others.

I am confused because Apple Developer page says this "For this purpose Apple Push Notification Service includes a feedback service that APNs continually updates with a per-application list of devices for which there were failed-delivery attempts" which leads me to believe that I should only get tokens on a per-application basis as opposed to all applications.

Can anybody confirm or deny how feedback service works with multiple apps, so I can then figure out where my problem is (if I have one at all)?

Thanks

hakre
  • 193,403
  • 52
  • 435
  • 836
jsherk
  • 6,128
  • 8
  • 51
  • 83
  • Are you sure you're using different certificates there? – deceze Apr 09 '12 at 02:00
  • I created new ones and deleted the old ones (I think)... If I used the old cert that would then retrieve the feedback for the other app correct? But the problem now is that once you get the feedback from apple its not there anymore, so I cant test to see if that was my problem or not! – jsherk Apr 09 '12 at 02:23
  • Did you get any info on this problem? – Daniel Magnusson Apr 11 '12 at 08:35
  • @DanielMagnusson No, I have not yet confirmed whether or not feedback service returns only those tokens for one app or for all apps yet. – jsherk Apr 11 '12 at 13:13
  • Apple's response to me so far has been "Read the documents", to which I replied "I have, but it does not answer my question".. still waiting to hear back from them. – jsherk Apr 26 '12 at 00:55

2 Answers2

2

I found some information on this:

The APNS feedback servers only return the device tokens that have "expired" since your last feedback request.

source

Which means if you send to several of your apps, then after X number of pushes to apple, call feedback() then feedback() will have inactive tokens from all your apps.

My current solution is to call feedback after each push to apple. Good enough for now ©

Community
  • 1
  • 1
Daniel Magnusson
  • 9,541
  • 2
  • 38
  • 43
  • I actually do two checks... one before the push and one after the push. But I still don't think it is clear on whether or not it will return all expired tokens for ALL apps in your developer account, or all expired tokens for only the app who's certificate is being used to connect. – jsherk Apr 12 '12 at 14:14
  • do we get to some identifier for payload to determine which notification failed ? – Kunal Balani Dec 05 '13 at 16:03
2

Well after sending Apple an email and waiting about 2 weeks, I finally got the following response from them:

Connecting to the feedback service uses the same TLS/SSL identity (certificate and private key) that you use to connect to the APNs gateway. APNs identifies which app you wish to communicate with from the UserID attribute of the certificate.

Therefore, just as you have to establish a separate connection to APNs for each app to send notifications, you have to do the same for the feedback service.

So you gave to make a separate connection for each app to the feedback service.

jsherk
  • 6,128
  • 8
  • 51
  • 83