Will identifierForVendor change when updating from

2019-03-31 21:07发布

问题:

We're currently using identifierForVendor which was introduced with iOS6. Now iOS7 was released and i wonder if this identifier will stay the same for my apps after the update process.

If i recover my device with iOS7 then it will obviously change, since it will be a fresh start.

How about the update via iTunes / OTA?

回答1:

I've also tested this behaviour with a little app that would just display identifierForVendor and it stayed the same before/after the update from iOS6 to iOS7.

What's also important to know is that the identifierForVendor isn't related to the apple developer account, but to the bundle identifier of an app.

So if you have 2 developer accounts and you create 1 app on each of them, using a bundle identifier com.company.xxx, they'll have the same identifierForVendor for having com.company. in common.

It will change based on the conditions mentioned in the UIDevice Class Reference.

The advertisingIdentifier may indeed change after the update. Didn't test that though.



回答2:

I've done a few tests (see Under what conditions is Apple's 'advertisingIdentifier' reset?), and it seems that yes, identifierForVendor indeed changes when updating to iOS 7.

At least that's what happened on an iPhone 4S and iPad mini I've updated (the former one with iTunes, the iPad over the air).

However, I don't know if that is the case for all users/devices and apps/provisioning profiles.


Update

Apple writes this, which might explain why the identifier changed for me but didn't for Kilian:

Comparing [[[UIDevice currentDevice] identifierForVendor] UUIDString] on multiple Enterprise applications or applications installed via Xcode (not the App Store), where the bundleIDs differ only in the last component, will result in identical strings. If the bundleID has 3 or less components, this behavior is unchanged from iOS 6.

This is due to a change in behavior between iOS 6 and iOS 7 where -[UIDevice identifierForVendor] takes into account the bundleID if there is no Vendor ID. Vendor ID is only assigned to apps on the App Store.



回答3:

The identifierforvendor also change when you delete the app and reinstall it!

Discussion 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 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.

FYI!



回答4:

YES, the Vendor ID will change! (at least if you are updating from iOS6 to iOS7)

great idea of apple to take out the mac-address... and this is even greater... who ever is responsible for this should get the medal of honor