iOS Developer Library — Pre-Release

Developer

AdSupport Framework Reference ASIdentifierManager Class Reference

Options
Deployment Target:

On This Page
Language:

ASIdentifierManager

The ASIdentifierManager class provides apps with access to an identifier that can be used only for serving advertisements, as well as a flag which indicates whether a user has limited ad tracking. More...

Inheritance


Conforms To


Import Statement


Swift

import AdSupport

Objective-C

@import AdSupport;

Availability


Available in iOS 6.0 and later.
  • An alphanumeric string unique to each device, used only for serving advertisements. (read-only)

    Declaration

    Swift

    var advertisingIdentifier: NSUUID! { get }

    Objective-C

    @property(nonatomic, readonly) NSUUID *advertisingIdentifier

    Discussion

    Unlike the identifierForVendor property of the UIDevice, the same value is returned to all vendors. This identifier may change—for example, if the user erases the device—so you should not cache it.

    If the value is nil, wait and get the value again later. This happens, for example, after the device has been restarted but before the user has unlocked the device.

    Import Statement

    Swift

    import AdSupport

    Availability

    Available in iOS 6.0 and later.

  • A Boolean value that indicates whether the user has limited ad tracking. (read-only)

    Declaration

    Swift

    var advertisingTrackingEnabled: Bool { get }

    Objective-C

    @property(nonatomic, readonly, getter=isAdvertisingTrackingEnabled) BOOL advertisingTrackingEnabled

    Discussion

    Check the value of this property before performing any advertising tracking. If the value is NOfalse, use the advertising identifier only for the following purposes: frequency capping, attribution, conversion events, estimating the number of unique users, advertising fraud detection, and debugging.

    Import Statement

    Swift

    import AdSupport

    Availability

    Available in iOS 6.0 and later.

  • Returns the shared instance of the ASIdentifierManager class.

    Declaration

    Swift

    class func sharedManager() -> ASIdentifierManager!

    Objective-C

    + (ASIdentifierManager *)sharedManager

    Return Value

    The shared instance of the ASIdentifierManager class.

    Import Statement

    Swift

    import AdSupport

    Availability

    Available in iOS 6.0 and later.