0

I want to generate a device specific random uuid which does not change even if the user uninstalls all my apps and reinstall unlike identifierforvendor. How can I achieve this is Swift

2 Answers 2

2

You can use the following function for creating the UUID:

func getUniqueDeviceIdentifierAsString() -> String { var appName: String? = (Bundle.main.infoDictionary?[(kCFBundleNameKey as? String)] as? String) var strApplicationUUID: String = SSKeychain.password(forService: appName, account: "incoding") if strApplicationUUID == nil { strApplicationUUID = UIDevice.current.identifierForVendor.uuidString SSKeychain.setPassword(strApplicationUUID, forService: appName, account: "incoding") } return strApplicationUUID } 

reference :How to preserve identifierForVendor in ios after uninstalling ios app on device?

Sign up to request clarification or add additional context in comments.

Comments

0

You need to create random UUID and save it to keychain. Try below link

https://github.com/taka0125/TAKUUID

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.