iOS Developer Library

Developer

iAd Framework Reference ADClient Class Reference

Options
Deployment Target:

On This Page
Language:

ADClient

Inherits From


Conforms To


Import Statement


Swift

import iAd

Objective-C

@import iAd;

Availability


Available in iOS 7.1 and later

The ADClient class is used to determine iAd-specific information about the app. Specifically, you use it to determine whether the app was installed as the result of user interaction with an ad associated with an iAd Network campaign.

To use this class, fetch the shared client object and call its determineAppInstallationAttributionWithCompletionHandler: method, passing in a block to be called with the result.

  • Returns the shared client instance.

    Declaration

    Swift

    class func sharedClient() -> ADClient!

    Objective-C

    + (ADClient *)sharedClient

    Return Value

    The shared client instance.

    Discussion

    You never initialize a new ADClient object. Instead, use this class method to get the shared instance.

    Import Statement

    Objective-C

    @import iAd;

    Swift

    import iAd

    Availability

    Available in iOS 7.1 and later

  • Determines whether the app was installed as the result of user interaction with an ad associated with an iAd Network campaign.

    Declaration

    Swift

    func determineAppInstallationAttributionWithCompletionHandler(_ completionHandler: ((Bool) -> Void)!)

    Objective-C

    - (void)determineAppInstallationAttributionWithCompletionHandler:(void (^)(BOOL appInstallationWasAttributedToiAd))completionHandler

    Parameters

    completionHandler

    A block to be called after the installation attribution is determined.

    The block receives the following parameter:

    appInstallationWasAttributedToiAd

    If YEStrue, then the app was installed as the result of user interaction with an ad associated with an iAd Network campaign. If NOfalse the user has either chosen to limit ad tracking or discovered the app through other means.

    Discussion

    The handler is called on an arbitrary queue.

    Import Statement

    Objective-C

    @import iAd;

    Swift

    import iAd

    Availability

    Available in iOS 7.1 and later