IdentifierForVendor

NSString *identifier = [[[UIDevice currentDevice] identifierForVendor] UUIDString]; 

The code above contains two different identifiers on the same phone in two of my applications: different package identifiers were created in my Apple account, but two application identifiers and two development profiles.

As far as I understand, if the team identifier is identical, the identifier for the provider should be the same in these two applications. Where is the mistake? What? I do not understand? first app

second app

+6
source share
3 answers

I am struggling with the same problem right now. The β€œanswer” is that the ForVendor ID is broken down according to its intended design in Apple Documentation:

It is assumed that the packet identifier is in reverse DNS format, and the first two components are used to generate the provider identifier. For example, com.example.app1 and com.example.app2 will have the same provider identifier.

What is the reality of the situation that the ForVendor identifier is identical only for applications that use the same provisioning profile and signing certificate. As an example, I have several applications in my Enterprise environment, all of which are com.mycompany ..

identifierForVendor is identical for applications using bundleID com.mycompany.app1. * and its preparation profile, however com.mycompany.app2, using the same signature certificate, but a different preparation profile gives a different ForVendor identifier value.

EDIT: This only happens in iOS7, but works fine in iOS6. I tested this for some time yesterday and can duplicate the problem within 7 days, but within 6 I get the expected results.

EDIT2: Apple moved target messages by identifier ForVendor. They apparently identified their problem with the algorithm and, instead of fixing the problem, changed the functionality of the identifier between versions of iOS with a change in documentation. An updated documentation link is provided below. SMH.

identifierForVendor

+6
source

The provider is not defined by the command identifier, but either:

  • Data provided by the App Store (if downloaded from the app store)
  • Parts of the bundle identifier (if deployed using any other means)

It depends on whether the device is running iOS 6 or 7+.

According to - [UIDevice identifierForVendor] documentation:

Typically, the provider is determined by the data provided in the App Store. If the application was not installed from the application store (for example, enterprise applications and applications still under development), then the vendor identifier is calculated based on the identifier of the application package. The packet identifier is assumed in reverse DNS format.

In iOS 6, the first two components of the bundle identifier are used to generate the vendor identifier. if the packet identifier has only one component, then the entire packet identifier is used.

In iOS 7, all components of a package except the last component are used to generate a vendor identifier. If the packet identifier has only one component, then the entire bundle identifier is used.

+4
source

This is because you have two different package identifiers.

The provider is identified by the first two dotted fields. So com.a.app1 and com.a.app2 have the same provider (com.a), but com.b.app3 has a different provider (com.b)

+2
source

All Articles