Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Receiving push notification even after the app is deleted iPhone

I implemented push notification in my app.

It is working fine.

Now the problem is even after i deleted my app from device it is getting the push notifications.

So is there any way to unregister the app from push notification when it is deleted from the device.

Hoping for your help.

Thanks in advance.

like image 248
suji Avatar asked Jul 18 '12 06:07

suji


1 Answers

In Apple push notification there is something called - Feedback Service. So when a user deletes an app, the service provider should ideally stop sending notifications to that device. But Apple does not notify the service that "this device is not using your app, dont send notifications". So instead you need to poll for this info.

Every day you might need to hit Apple Notification servers asking it to give you device Ids who have deleted your app. Once you get them you mark them in your DB as deleted thereby not sending any more notifications. Hope this is what you wanted.

From Apple Documentation -

... 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. The devices are identified by device tokens encoded in binary format. Providers should periodically query the feedback service to get the list of device tokens for their applications, each of which is identified by its topic. Then, after verifying that the application hasn’t recently been re-registered on the identified devices, a provider should stop sending notifications to these devices.

Access to the feedback service takes place through a binary interface similar to that used for sending push notifications. You access the production feedback service via feedback.push.apple.com, port 2196; you access the sandbox feedback service via feedback.sandbox.push.apple.com, port 2196. As with the binary interface for push notifications, you must use TLS (or SSL) to establish a secured communications channel. The SSL certificate required for these connections is the same one that is provisioned for sending notifications. To establish a trusted provider identity, you should present this certificate to APNs at connection time using peer-to-peer authentication.

Be sure to checkout - Issues with Feedback Service

like image 93
Srikar Appalaraju Avatar answered Nov 09 '22 23:11

Srikar Appalaraju