Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
456 views
in Technique[技术] by (71.8m points)

ios - apns http2 api not returning status 410 after uninstalling app

Im using apns with http2 protocol for sending pushnotifications, the code i use is similar to this post: https://stackoverflow.com/a/34831873/1546652

When my app is correctly installed the apns http2 api works ok while sending messages, my reponse is something of the style : {"response":"","httpcode":200}

The problem is that when i uninstall the app and send a pushnotification to the invalid registrationId i dont receive status 410 nor the response "reason:Unregistered" and still receive a true response with status 200.

How can i receive 410 status and correspondig response when unistall the app in apns http2?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This technical note might be of help, basically

iOS will keep one socket connection per APNS environment (Production/ Sandbox) and when you delete the app from iOS, if its a last app for a given environment it kills that socket connection as well, which causes the deletion event to be dropped for that last app.

This generally happens with development apps.

The solution is to keep a dummy app installed on a device which registers for APNs and is signed with developer identities, now when you delete your real app from device during development it will keep the connection to APNS open resulting in app deletion being reported to APNS.

Also, In my testing I have experienced delays around 30-60 mins before an app deletion is reflected in APNS Response.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...