Bhagwat K
Bhagwat K

Reputation: 3142

ios- Get unique identifier which should have to be same after reinstalling of the app

I have a use case that I want to bind the user with a particular device id. So that purpose I need a unique device identifier.

When I search for this issue I found some solutions like

So my question is it possible to read any unique identifier? If yes then how can I read it either with swift or objective-c?

Upvotes: 2

Views: 2141

Answers (3)

V D Purohit
V D Purohit

Reputation: 1189

My suggestion is take UUID as well as use case whatever you bind with user then after if user register at that time store your use case as well as UUID and also create unique userId for that.If user is logged out and login again you can check userID and with unique parameter like userEmail or contact which already exists to not?If exist then replace your use case with new(if use case you used each time).

I hope it will help you. Thanks

Upvotes: 0

taka
taka

Reputation: 1427

At least iOS 12.1 doesn't remove Keychain on app's uninstall.

This removing behavior is once introduced in iOS10.3 Beta 2, but reverted later.


In some case DeviceCheck APIs, Apple officially offers, can be solution.

This seems most reliable and decent way, if it meets your requirement.

c.f. https://developer.apple.com/documentation/devicecheck

Using the DeviceCheck APIs, in combination with server-to-server APIs, you can set and query two bits of data per device, while maintaining user privacy. You might use this data to identify devices that have already taken advantage of a promotional offer that you provide, or to flag a device that you've determined to be fraudulent. The DeviceCheck APIs also let you verify that the token you receive comes from an authentic Apple device on which your app has been downloaded.

Upvotes: 1

Sagar Chauhan
Sagar Chauhan

Reputation: 5823

There is no longer a way to uniquely identify a device after the user uninstalled the app(s). The documentation says:

The value in this property remains the same while the app (or another app from the same vendor) is installed on the iOS device. The value changes when the user deletes all of that vendor’s apps from the device and subsequently reinstalls one or more of them.

Reference: https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor

Upvotes: 0

Related Questions