To detect invalid tokens, how often should I check the feedback service?
I have implemented a broadcasting system using the APNS service. I open a connection, send all the APNS messages, and disconnect. I then open a feedback connection right after the broadcast completes, and read any invalid tokens.
I do get invalid tokens on the feedback connection. However, often my broadcast will only partially succeed (some devices receive and others do not), and when I remove all but the known-good tokens, my test devices consistently receive the message.
I assume that means Apple is stopping the broadcast after it receives the first few invalid tokens.
So am I not listening on the Feedback properly?
Was this article helpful? APN certificate(s) downloaded from Apple only have one year validity from the date it was created.
The APNs system includes a feedback service that can be queried to check for devices that have unregistered and no longer need to be notified. The device tokens maintainer: A Web Services server program maintaining the database of device tokens, with application user information.
The average person gets between 65 and 80 phone notifications a day, according to research being conducted at Duke University that was presented at a recent American Psychological Association Conference.
Push notification is also a powerful marketing tool. According to Invespcro, push notifications can boost app engagement by 88% and have led to 48% of mobile users making an in-store purchase. However, a push notification can get intrusive if not done the right way.
In the end, the only way to properly handle this problem was to move to Apple's newer "enhanced notification format". This format allows you to provide an ID to each message you send, and when Apple disconnects you, they send you the error and the ID of the message that caused the error.
This allows for the client to properly retry already sent messages, and drop the token that was invalid
You should check the feedback response every time you send a push and delete inactive devices. Although, this does not look like your problem right now.
Your problem looks like you have some invalid tokens in your database. Apple will drop your connection if you send invalid tokens. Sending an inactive token will have no effect, but if you send a malformed/invalid token, Apple will kill your socket.
The other problem could be a missing retry scheme on your side. Did you implement any routine that will re-open the connection with Apple if it drops while you push ? You have to predict that the connection can fail, and if it does, you have to put it back up and start pushing again from where you stopped.
What you should look for is:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With