Urban Airship shares the following two options:
In any case, applications should expect and handle inactive device tokens properly. We recommend that developers either:
- Register the device token every time the application is opened, like our sample app does
- Use our feedback API regularly, store inactivated device tokens in your own database, and send registrations when the device token becomes active again.
If you make an additional call to the Urban Airship to check if the device exists and is active, even then the 'active devices list' may not always be completely accurate because Urban Airship relies on periodic updates from Apple Feedback Service:
Apple tells us that the application has been uninstalled via the feedback service, which we check on a regular basis.
Also, do remember what Apple has stated about the delivery of Push Notifications:
Important: Delivery of notifications is a “best effort”, not guaranteed. It is not intended to deliver data to your app, only to notify the user that there is new data available.