ASIdentifierManager Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AdSupport.framework
Availability
Available in iOS 6.0 and later.
Declared in
ASIdentifierManager.h
Related sample code

Overview

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.

This class is expected to be used by developers who are implementing a system for serving ads. These organizations typically provide app developers with the code that interacts with this class. App developers may need to link against the Ad Support framework to use that code, but they should not need to interact with the ASIdentifierManager class directly.

To get the advertising identifier:

  1. Get a reference to the shared instance of this class using the sharedManager method.

  2. Check whether advertising tracking is limited using the advertisingTrackingEnabled property.

    If the user has limited ad tracking, use the advertising identifier only for the following purposes: frequency capping, conversion events, estimating the number of unique users, security and fraud detection, and debugging.

  3. Get the advertising identifier using the advertisingIdentifier property.

Tasks

Getting the Advertising Identifier

Properties

advertisingIdentifier

An alphanumeric string unique to each device, used only for serving advertisements. (read-only)

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

Availability
  • Available in iOS 6.0 and later.
Declared In
ASIdentifierManager.h

advertisingTrackingEnabled

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

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

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

Availability
  • Available in iOS 6.0 and later.
Declared In
ASIdentifierManager.h

Class Methods

sharedManager

Returns the shared instance of the ASIdentifierManager class.

+ (ASIdentifierManager *)sharedManager
Return Value

The shared instance of the ASIdentifierManager class.

Availability
  • Available in iOS 6.0 and later.
Declared In
ASIdentifierManager.h