NSString *identifier = [[[UIDevice currentDevice] identifierForVendor] UUIDString];
The code above gives two different identifiers on the same phone in two my applications - different bundle ids but two App IDs and two development provisioning profiles were created on my Apple account.
How I understand, if the Team ID is the same, the identifier for vendor should be the same in these two apps. Where is the mistake? What I don't understand?
An alphanumeric string that uniquely identifies a device to the app's vendor.
The identifierForVendor is an unique identifier that stays the same for every app of a single vendor on a single device, unless all of the vendor's apps are deleted from this device. See Apple's documentation about when this UUID changes.
The definition of IDFV? The Identifier for Vendors (IDFV) is a code assigned to all apps by one developer and is shared across all apps by that developer on your device. The value of the IDFV is the same for apps from the same developer running on the same device.
There is no longer a way to uniquely identify a device after the user uninstalled the app(s). The 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.
I am fighting the same issue right now. The "answer" is that identifierForVendor is broken per its intended design within the Apple Documentation:
The bundle ID is assumed to be in reverse-DNS format, and the first two components are used to generate a vendor ID. For example, com.example.app1 and com.example.app2 would appear to have the same vendor ID.
What the reality of the situation is that the identifierForVendor is only identical for apps using the same provisioning profile and signing certificate. As an example I have multiple apps in my Enterprise environment, all of which are com.mycompany..
identifierForVendor is identical for apps using the bundleID com.mycompany.app1.* and its provisioning profile however com.mycompany.app2 using the same signing certificate but different provisioning profile yields a different identifierForVendor value.
EDIT: This is only occurring in iOS7 but works fine in iOS6. I tested this for a while yesterday and can duplicate the issue in 7 all day but within 6 I get the expected results.
EDIT2: Apple has moved the goal posts on identifierForVendor. They apparently identified their algorithm problem and, instead of fixing the issue, have changed the identifier's functionality between iOS versions with a documentation change. Updated documentation link is below. SMH.
identifierForVendor
The vendor is not determined by the team ID, but by either:
This varies depending on whether the device is running iOS 6 or 7+.
According to the -[UIDevice identifierForVendor] documentation:
Normally, the vendor is determined by data provided by the App Store. If the app was not installed from the app store (such as enterprise apps and apps still in development), then a vendor identifier is calculated based on the app’s bundle ID. The bundle ID is assumed to be in reverse-DNS format.
On iOS 6, the first two components of the bundle ID are used to generate the vendor ID. if the bundle ID only has a single component, then the entire bundle ID is used.
On IOS 7, all components of the bundle except for the last component are used to generate the vendor ID. If the bundle ID only has a single component, then the entire bundle ID is used.
Its because you have 2 different bundle id's.
A vendor is identified by the first two dot separated fields. So com.a.app1 and com.a.app2 have same vendor (com.a) but com.b.app3 has a different vendor (com.b)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With