is there a way to check two device tokens are belongs to same device?

73 views Asked by At

I want to get the device token of the device and want to send it to a server.Sometimes if I uninstall the app and install it again,Then the new device token which I got is different than previous.So,In my server there are two device tokens which are belong to same device.Can we avoid that?(In my service,I want to keep only one device token per one device) Thank you.

2

There are 2 answers

0
Vaionixx On

If you doing this for push notification, you can use the feedback service from apple to detect if a device is deleted.

0
Zev Eisenberg On

You can store a generated UUID and store it in the keychain like this. If you set it up right, it will persist between app deletes and reinstalls on the same device, but not across multiple devices via a restore from backup (unless you want that).