简体   繁体   中英

PHP Apple Push Notifications feedback service

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

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 ©

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM