How do I know when the app quits on iOS?

Asked

Viewed 563 times

1

I’m developing an app that sends notification by push, but so that my server does not send notifications to the devices from which my application was uninstalled and does not pollute my server, as I might know when the user uninstalled my application?

1 answer

4


There is no way to determine if an application has been uninstalled from the system.

But there is a feedback service that is intended to inform about failures in sending notifications, ie when it fails to be delivered precisely because the target device no longer has the application.

The information you get from this service is a list of tokens, then, as well recommended in the documentation, you can call this service daily to get this list and do a clean up in your database when needed.

Sample links using PHP for feedback:

1 - https://stackoverflow.com/questions/1278834/php-technique-to-query-the-apns-feedback-server

2 - https://stackoverflow.com/questions/4774681/php-script-for-apple-push-notification-feedback-service-gets-timeout-every-time

3 - https://stackoverflow.com/questions/15943671/how-get-feedback-from-apns-when-sending-push-notification

  • Yeah, I did a little research yesterday, and that’s really the only way. I will edit the reply including links with ways to access the feedback service. Thanks @Paulorodrigues.

  • Important note, the link: 2 really works! Just put the cert_desenvolvimento.pem or cert_distriuicao.pem. Adjust the variable #apnsPort to 2196 and to allocate $useDev = TRUE; to carry out development tests or FALSE for actual distribution testing/use. Delete the first line funticion checkFeedbackServer($appBundle,$useDev=TRUE) { E the Chavez } at the end to work directly on the code.

  • I did some tests of this service and it is inaccurate, because in the feedback comes the last push date that the app did not receive, and not the oldest push date it did not receive. So the inaccuracy is very great, and it does not serve the purpose I have in mind. Because I need to know if the app does not receive the push within 60 days. To ensure that the user no longer receives the push. Or create a logic to store this feedback data and create a history of incoming pushs.

  • It’s not that the service is inaccurate, it just doesn’t work the way you wanted it to. The idea is just this, you also maintain a database of notifications not received and depending on the amount (or time interval) you already deduce that the device no longer has your application and does what should be done.

  • Got it, I’ll see another way, I’ll devise a way for the app to maintain a notification with the bank, and if the notification does not occur in an X time interval I will consider as inactive app and notify the user by email. Thanks again!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.