Question
I’m trying to understand how UIDevice.current.identifierForVendor behaves when an iOS app is restored from iCloud backup onto a different physical device.
Context
I’m developing an iOS app that needs to detect when it’s running on a newly restored device (for example, after a user sets up a new iPhone from an iCloud backup).
To do this, I save the value of:
UIDevice.current.identifierForVendor?.uuidString
in persistent storage (such as UserDefaults), and I compare it on next launch to see if it changed.
The Question
If I install my app on Device A, store its identifierForVendor, back it up to iCloud,
and then restore that backup onto Device B, will the restored app on Device B see the same identifier or a new one?
Specifically:
Does iCloud backup or device migration preserve the identifierForVendor value?
Is the IDFV tied only to the vendor prefix (bundle ID), or also to the physical device hardware?
What happens if the user deletes all apps from that vendor and reinstalls or restores them later?
Goal
I want to know whether it’s safe and reliable to use identifierForVendor to detect when an app has been restored onto a different device — for example, to trigger a Firebase token refresh in my backend when a user’s device changes.
What I’ve Found So Far
Apple’s documentation
says:
The value of this property is the same for apps that come from the same vendor running on the same device.
If the user deletes all of that vendor’s apps from the device and then reinstalls one or more of them, the value may change.
However, this doesn’t clearly state what happens after restoring an iCloud backup to another physical device.
I’ve seen conflicting results in forums — some developers report it changes, others say it can persist under certain migration methods.
TLDR;
After an iCloud restore to another physical device, does UIDevice.current.identifierForVendor remain the same or change?