Just upgraded my Angular + Ionic + Capacitor to versions:
@capacitor/core 4.7.3
@capacitor/device 4.1.0
@angular/common 15.2.7
@angular/core 15.2.7
@ionic/angular 7.0.2
My app calls for the the getId().uuid property using the @capacitor/device library.
It used to provide consistent uuid for a given device across installations, but now it yields a different uuid following every new app installation to an iOS device, either locally from xcode or through TestFlight. The iOS uuid is in the following format: 1638A471-EC8A-4331-8809-A163871C7261
This is not experienced on an Android device (although only tested with local installations through Android Studio).
Any thought on this?
Thank you!
This is the intended behavior, see identifierForVendor:
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.
Oh my!
Thank you for pointing this out.
Any other way I can get a consistent device id?
Basically I need to be able to know, upon app start, if the user on this specific device had already signed-up to my app.
I currently just store this device ID in the app (cloud) DB, but now that it may be changing, I cannot rely on it.
Any other ideas?
As far as I know, this is not possible for privacy reasons.
keychain is not deleted on app deletion, so you can use a plugin that uses keychain to store some value, so if on first app start there is a value there, it means the app was installed before
Thanks, Julio.
As the keychain cordova plugin is iOS-specific, I will opt not to use it as it is not consistent across platforms.
Thanks for the tip!
Mor