Paul
Paul

Reputation: 1019

Unsubscribe from Apple Push Notification service

I'm developing an iOS app that enables the user to observe technical devices and be notified if there are problems.

What I know so far:

  1. My app requests a token from the APNs.
  2. My app sends this token to my server.
  3. My server notifies the APNs in case of an event.
  4. The APNs pushes a message onto the device.

What I want to know:

Highest priority in my case is for the server to know which devices are registered with the service. Old devices (old tokens that is) need to be removed immediately.

Thanks for your help.

Upvotes: 2

Views: 4477

Answers (1)

Bastian
Bastian

Reputation: 10433

You should register for the remote notification on every app launch and send the token to your server.

To check if the user removed the app or disabled notifications you have to check the feedback service. Look for it on this page:

https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/BinaryProviderAPI.html#//apple_ref/doc/uid/TP40008194-CH13-SW1

Note: APNs monitors providers for their diligence in checking the feedback service and refraining from sending push notifications to nonexistent applications on devices.

Upvotes: 2

Related Questions