An object containing an identifier to be used only for serving advertisements, and a flag indicating whether a user has limited ad tracking.


class ASIdentifierManager : NSObject


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 shared() method.

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

  3. Get the advertising identifier using the advertisingIdentifier property (note that when ad tracking is limited, the value of the advertising identifier is 00000000-0000-0000-0000-000000000000).


Getting the Shared Manager

class func shared() -> ASIdentifierManager

Returns the shared instance of the ASIdentifierManager class.

Getting the Advertising Identifier

var advertisingIdentifier: UUID

An alphanumeric string unique to each device, used only for serving advertisements.

var isAdvertisingTrackingEnabled: Bool

A Boolean value that indicates whether the user has limited ad tracking.

func clearAdvertisingIdentifier()

Clears the app's current advertising identifier, forcing the creation of a new advertising identifier the next time you need one.


Inherits From

Conforms To

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software