richie
richie

Reputation: 101

Urban Airship Delete Device ID / Token

I'm trying to completely unregister a device token using the Urban Airship API (http://docs.urbanairship.com/api/), previously registered via an iOS device. I am doing this because I would like to verify the complete remote notification registration process.

There is a GET device_id endpoint:

GET /api/device_tokens/<device_token>

I was hoping there would be an endpoint like:

DELETE /api/device_token/<device_token>
DELETE /api/device_tokens (+send json data)

Maybe what I'm looking for can be achieved some other way? Or maybe this is an incorrect flow? I believe the old interface/API had this capability which is why I assumed it still existed.

Right now I'm relying on the "last_registration" value (from the GET endpoint) to inform me that the device has been registered, but I would like some way to completely remove the registered device/token via the API.

Upvotes: 1

Views: 998

Answers (1)

Donato Perconti
Donato Perconti

Reputation: 813

Doesn't work that way. Apple is the one the assigns and manages the lifecycle of device tokens. Urban Airship is a provider that handles the management/storage/utilization of said device tokens. Apple, however, is the one that manages the lifecycle of the device token based on the device and its actions. The best thing is to simply listen to the feedback to determine if that device token is still active or not. Apple's documentation on the matter is available here.

In regards to the old API; there was indeed a way to mark the device as inactive. However, as stated above, Apple manages the device tokens status. So, if the DT was indeed 'active' despite a delete/inactivate call was made on that DT, Apple would simply re-activate that DT, rendering that endpoint pointless.

Upvotes: 1

Related Questions