Domanda

See https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html

at "Quality of Service" section:

If the device remains offline for a long time, any notifications that were being stored for it are discarded.

It is difficult to test... so i am asking here, what happen in this case?

  • The device token goes to the feedback service?
  • Is it possible to know when this happen?
  • Nothing happen and nobody will never know about it?
È stato utile?

Soluzione

The device token won't go to the feedback service, since the application wasn't uninstalled from that device.

You will have no way to know this happened (since Apple doesn't notify you about discarded messages), unless you implement a mechanism in your app that calls your server to acknowledge the message delivery. If you send the notification with expiry time of T seconds, and don't get an acknowledgment from the app within T seconds, you can assume the device was offline during those T seconds and the message discarded. However, you won't know for sure, since even when the notification arrives to the device, your acknowledgment API call will be executed only when the user taps the notification (unless your app is for iOS7 and you are using the new feature of contacting your server in the background before the notification is tapped).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top