Wiki
Clone wikiBanner Sample / AATDelegate
AATKit Delegates
Index:
AATDelegate
AATDelegate
notifies you with all AATKit events.
Swift:
#!swift public protocol AATDelegate: AnyObject { /// Notifies that the AATKit has obtained ad rules. /// /// - Parameter fromTheServer: Indicates if the rules came from the server. It will return false if the currently used rules come from the ``AATSDK/setInitialRules(rules:)`` method or the cached rules are used. @objc optional func AATKitObtainedAdRules(fromTheServer: Bool) /// Notifies that application's bundle ID was not recognized by the AddApptr server. @objc optional func AATKitUnknownBundleId() }
Usage
you need to implement AATDelegate
and pass it to AATKit while configuring AATKit.
Objective-C:
#!objective-c AATConfiguration *configuration = [[AATConfiguration alloc] init]; configuration.delegate = self; // ... other configuration [AATSDK initAATKitWith:configuration];
Swift:
#!swift let configuration = AATConfiguration() configuration.delegate = self // ... other configuration AATSDK.initAATKit(with: configuration)
AATStatisticsDelegate
AATStatisticsDelegate
notifies you of all placements reporting events:
Swift:
#!swift public protocol AATStatisticsDelegate: AnyObject { /** * Notifies that an adspace has been counted. */ func AATKitCountedAdSpace() /** * Notifies that an request has been counted for a given network. * * - Parameter network: Network for which the request has been counted. */ func AATKitCountedRequest(for network: AATAdNetwork) /** * Notifies that an response has been counted for a given network. * * - Parameter network: Network for which the response has been counted. */ func AATKitCountedResponse(for network: AATAdNetwork) /** * Notifies that an impression has been counted for a given network. * * - Parameter network: Network for which the impression has been counted. */ func AATKitCountedImpression(for network: AATAdNetwork) /** * Notifies that an viewable impression has been counted for a given network. * * - Parameter network: Network for which the viewable impression has been counted. */ func AATKitCountedVImpression(for network: AATAdNetwork) /** * Notifies that an click has been counted for a given network. * * - Parameter network: Network for which the click has been counted. */ func AATKitCountedClick(for network: AATAdNetwork) /** * Notifies that an direct deal impression has been counted for a given network. * * - Parameter network: Network for which the direct deal impression has been counted. */ func AATKitCountedDirectDealImpression(for network: AATAdNetwork) /** * Notifies than an mediation cycle has been counted. */ func AATKitCountedMediationCycle() }
all of the above methods are optional so you can implement any method you want to get notified with the corresponding event.
Usage
You need to implement AATStatisticsDelegate
and pass it to the placement (All placements types have the statisticsDelegate
property):
Swift:
placement.statisticsDelegate = self
Objective-C:
self.placement.statisticsDelegate = self;
Updated