iOS Question Is Device ID changes between debug and release?

Alex_197

Active Member
Licensed User
Hi all.

I'm using this code to get the device ID
B4X:
Sub GetVendorIdentifier As String
    Dim no As NativeObject
    no = no.Initialize("UIDevice").RunMethod("currentDevice", Null)
    Dim id As Object = no.GetField("identifierForVendor").GetField("UUIDString")
    Return id
End Sub

What I've noticed that it changes between debug mode and release mode.

For example - in debug mode I registered the device id with my web site and I see what it was. Then I uploaded my app to the apple store, deleted the debug version of the app from the phone, installed again on the same phone under TestFlight. The device id has was different. Why?

Thanks.
 

Alex_197

Active Member
Licensed User
Guess you try to identify user phone. To do this you can use a keychain (Phone object, ,KeychainGet/Put). Uninstall is not dangerous
Thanks, if the user deleted the app from his phone he needs to register it again so I don't care what it was before. I didn't expect that the Device ID changes between development and the app store as Erel said in #2
 
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
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. The value can also change when installing test builds using Xcode or when installing an app on a device using ad-hoc distribution. Therefore, if your app stores the value of this property anywhere, you should gracefully handle situations where the identifier changes.
 
Upvote 0
Top