UIKit.UIDevice.IdentifierForVendor Property
An identifier, unique to the device, based on the App Store vendor or, if not from the App Store, the bundle identifier.

Syntax

[ObjCRuntime.Availability(Introduced=ObjCRuntime.Platform.iOS_6_0)]
[get: Foundation.Export("identifierForVendor")]
[get: ObjCRuntime.Availability(Introduced=ObjCRuntime.Platform.iOS_6_0)]
public virtual Foundation.NSUuid IdentifierForVendor { get; }

Value

Documentation for this section has not yet been entered.

Remarks

This identifier is the same for a particular device for all apps that come from the same vendor. This identifier is not the same across devices.

If the app does not come from the App Store, the "vendor" of the device is calculated based on the bundle ID. In iOS 7 and later, the "vendor" is based on all elements of the bundle ID except the last component. In other words, if the bundle ID is com.mycompany.mydivision.app1, the "vendor" will be calculated as com.mycompany.mydivision. On iOS 6 and previous, the "vendor" is calculated from the first two components, so a bundle ID of com.mycompany.mydivision.app1 would base the vendor on com.mycompany.

The UIKit.Foundation.NSUuid.AsString() method is often used to extract the actual identification, as shown in the following example:

C# Example

var nsUid = UIDevice.CurrentDevice.IdentifierForVendor;
var guidElements = nsUid.AsString();
Console.WriteLine("ToString() : {0}\nAsString() : {1}", nsUid, guidElements);
/*
ToString() : <__NSConcreteUUID 0x79ef50> 959E8282-D65E-486C-B1D3-17D720CF668E
AsString() : 959E8282-D65E-486C-B1D3-17D720CF668E
*/              
              

This can be used from a background thread.

Requirements

Namespace: UIKit
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0