AATKit iOS Integration
Release Notes
  • Start
    • Setup
      • Minimum iOS Version
      • Cocoapods
      • Swift Package Manager
      • AATKit Reporting
      • App Transport Security (ATS)
      • SKAdNetwork
    • Initialization
    • Consent
      • General Handling
      • Managed Consent
        • Google CMP
        • Sourcepoint CMP
        • SFBX (AppConsent) CMP
      • Vendor Consent
      • Simple Consent
    • Plugins documentation
    • Additional Information
  • Formats
    • Introduction
    • Banner
      • Auto Load Banner
      • Multi-Size Auto Load Banner
      • Banner Cache
      • Infeed Banner
      • Asynchronous Infeed Banner
      • Sticky Banner
      • Multi-Size Banner
    • Fullscreen (Interstitial)
    • AppOpen (Google)
    • Rewarded Video
      • Server-Side Verification (SSV)
    • Native Ad
      • Basic Integration
      • Asynchronous Basic Integration
      • Network Specifics
        • Native Ads: Google
  • Ad Networks
    • Customize Ad Networks
    • Privacy Requirements
    • Google Mobile Ads SDK
    • AppNexus Custom Interstitial Auto Dismiss Delay
    • FeedAd Banner Options
    • AmazonHB
  • Advanced
    • Targeting
      • Key-Value Targeting
      • User Targeting
      • Content Targeting URL
    • Frequency Capping
    • Advanced Delegates
      • Reports Delegate
      • Impression Delegate (ILRD)
      • Statistics Delegate
    • AATKit's Size
    • Ad Space and Fill Rate
    • Shake Debug
    • Publisher Provided ID
    • Child-directed Support
    • Disabling Ad Networks
    • Geo Tracking
    • Ad Quality
    • Creatives History
  • Other
    • AdMob Custom Events
    • Datonomy
    • Reference
      • Classes
        • AATConfiguration
        • AATRuntimeConfiguration
        • AATManagedConsent
        • AATVendorConsent
        • AATSimpleConsent
        • AATAdInfo
        • AATBannerConfiguration
        • AATBannerRequest
        • AATBannerCacheConfiguration
        • AATBannerAlign
        • AATPlacementHistoryInfo
        • AATReward
        • AATRewardedAdSSVInfo
        • AATNativeAdRating
        • AATImpression
        • AATPriceInfo
        • AATAdNetworksOptions
          • AATAppNexusOptions
          • AATFeedAdOptions
          • AATAdMobOptions
          • AATDFPOptions
          • AATDatonomyOptions
        • AATDebugInfo
        • AATDebugScreenConfiguration
        • AATUserTargeting
        • AATCollapsibleBannerOptions
      • Protocols
        • AATDelegate
        • AATManagedConsentDelegate
        • AATVendorConsentDelegate
        • AATPlacement
        • AATStickyBannerPlacement
        • AATStickyBannerPlacementDelegate
        • AATMultiSizeBannerPlacement
        • AATMultiSizeBannerPlacementDelegate
        • AATInfeedBannerPlacement
        • AATInfeedBannerPlacementDelegate
        • AATAsyncInfeedBannerPlacement
        • AATBannerRequestDelegate
        • AATBannerCache
        • AATBannerCacheDelegate
        • AATBannerCacheStatusDelegate
        • AATAutoLoadBannerPlacement
        • AATAutoLoadBannerPlacementDelegate
        • AATAutoLoadMultiSizeBannerPlacement
        • AATAutoLoadMultiSizeBannerPlacementDelegate
        • AATFullscreenPlacement
        • AATFullscreenPlacementDelegate
        • AATAppOpenAdPlacement
        • AATAppOpenPlacementDelegate
        • AATRewardedVideoPlacement
        • AATRewardedVideoPlacementDelegate
        • AATNativeAdPlacement
        • AATNativePlacementDelegate
        • AATAsyncNativeAdPlacement
        • AATNativeAdData
        • AATReportsDelegate
        • AATImpressionDelegate
        • AATStatisticsDelegate
      • Enumerations
        • AATAdNetwork
        • AATGender
        • AATLogLevel
        • AATManagedConsentState
        • NonIABConsent
        • AATBannerPlacementSize
        • AATBannerSize
        • HorizontalAlign
        • VerticalAlign
        • AATMediationType
        • AATImpressionPricePrecisionType
  • Samples
  • Other Platforms
Powered by GitBook
On this page
  • Configure AATKit
  • Reconfigure AATKit
  • Test Mode
  • Using an Alternative bundle ID
  • Handling (multiple) View Controllers
  • Log Levels
  1. Start

Initialization

Add, import, and configure AATKit

Last updated 3 months ago

Configure AATKit

Before loading ads, the app must initialize AATKit first. This only needs to be done once per app session, ideally at the app launch. You should call the initAATKit(with configuration: AATConfiguration?) as early as possible to ensure optimal ad performance.

Call the initialization method with an instance which contains the necessary configuration data needed to initialize AATKit. Through , you can listen to AATKit callbacks such as obtaining mediation rules from the backend or unknown bundleID events.

let configuration = AATConfiguration()
configuration.delegate = self
AATSDK.initAATKit(with: configuration)
AATConfiguration *configuration = [[AATConfiguration alloc] init];
configuration.delegate = self;
[AATSDK initAATKitWith:configuration];

You can add some extra configurations for some ad networks using . For more information, see section.

Reconfigure AATKit

AATKit enables reconfiguring it at runtime. This might be needed for some cases like reacting to consent changes or geo-location settings changes. To reconfigure AATKit, use the reconfigure public API passing an instance of .

let newConfiguration = AATRuntimeConfiguration()
newConfiguration.consentRequired = true
newConfiguration.consent = AATSimpleConsent(nonIABConsent: .obtained)
newConfiguration.isUseGeoLocation = true
AATSDK.reconfigure(configuration: newConfiguration)
AATRuntimeConfiguration *newConfiguration = [[AATRuntimeConfiguration alloc] init];
newConfiguration.consentRequired = YES;
newConfiguration.consent = [[AATSimpleConsent alloc] initWithNonIABConsent:NonIABConsentObtained];
newConfiguration.isUseGeoLocation = YES;
[AATSDK reconfigureWithConfiguration:newConfiguration];code b

Test Mode

AATKit’s test mode provides ads even before your app has been set up at Gravite. This is convenient for testing your integration Please use your testModeAccountId to activate the test mode. Set the testModeAccountId in your object. The testModeAccountId will be sent to you via email after registering at .

let configuration = AATConfiguration()
configuration.delegate = self
configuration.testModeAccountId = <TEST_MODE_ID>
AATSDK.initAATKit(with: configuration)
AATConfiguration *configuration = [[AATConfiguration alloc] init];
configuration.delegate = self;
configuration.testModeAccountId = <TEST_MODE_ID>;
[AATSDK initAATKitWith:configuration];

Make sure to remove the testModeAccountId from your AATConfiguration object, before you publish your app to the AppStore. Otherwise, your app will not earn any ad revenue.

Using an Alternative bundle ID

AATKit will do dashboard reporting using your alternative bundle ID by default if you set it.

configuration.alternativeBundleId = "com.alternativeBundleID"

// if you still need to report on the physical bundleID call this:
// configuration.shouldReportUsingAlternativeBundleId = false
configuration.alternativeBundleId = @"com.alternativeBundleID";

// if you still need to report on the physical bundleID call this:
// configuration.shouldReportUsingAlternativeBundleId = NO;

Handling (multiple) View Controllers

Set the currently active view controller for AATKit before requesting ads from placements. You should set the view controller in your view controller viewDidAppear(_ animated: Bool) lifecycle method.

Placements will not start loading ads before having the current view controller passed to AATKit.

Set the Current View Controller

AATSDK.controllerViewDidAppear(controller: self)
[AATSDK controllerViewDidAppearWithController:self];

Remove the Current View Controller

AATSDK.controllerViewWillDisappear()
[AATSDK controllerViewWillDisappear];

Log Levels

AATKit supports the following log levels:

Verbose

Verbose-level messages are intended to capture verbose, debug, info, warning and error messages. It’s convenient in an intensive development environment.

AATSDK.setLogLevel(logLevel: .verbose)
[AATSDK setLogLevelWithLogLevel:AATLogLevelVerbose];

Debug

Debug-level messages are intended to capture debug, info, warning and error messages. It’s convenient in a normal development environment.

AATSDK.setLogLevel(logLevel: .debug)
[AATSDK setLogLevelWithLogLevel:AATLogLevelDebug];

Info

Info-level messages are intended to capture info, warning and error messages. Info-level may be helpful but isn’t enough for troubleshooting.

AATSDK.setLogLevel(logLevel: .info)
[AATSDK setLogLevelWithLogLevel:AATLogLevelInfo]

Warn

Warn-level messages are intended to capture warning and error messages only.

AATSDK.setLogLevel(logLevel: .warn)
[AATSDK setLogLevelWithLogLevel:AATLogLevelWarn];

Error

Error-level messages are intended to capture error messages only.

AATSDK.setLogLevel(logLevel: .error)
[AATSDK setLogLevelWithLogLevel:AATLogLevelError];

Gravite recognizes and identifies your app using its bundle ID. Should you need to use a different bundle ID for publishing or testing or other purposes, you can override the default bundle ID of your app by setting an "alternative bundle ID" for the object. But: before you can use the alternative bundle ID properly, please make sure that our has set up your app for the alternative bundle ID, as this is not a standard procedure.

If for any reason reporting should still be done using your app's real bundle Id, you can set the shouldReportUsingAlternativeBundleId property of the object to false.

If you decide to use an alternative bundle ID, please contact our .

AATConfiguration
AATDelegate
AATAdNetworksOptions
Ad Networks
AATRuntimeConfiguration
AATConfiguration
Gravite
AATConfiguration
support
AATConfiguration
support