AATKit React Native Integration
Release Notes
  • Start
    • Setup
    • Expo
    • Initialization
    • App Tracking Transparency
    • Google Mobile Ads SDK
    • Consent
      • Managed Consent
      • Vendor Consent
      • Simple Consent
  • Formats
    • Banner
    • In-Feed Banner
    • Fullscreen (Interstitial)
    • Rewarded Video
    • Native Ad
  • Other
    • Banner Reuse
    • Screens Navigation
    • Reference
      • RNAatkit
        • Functions
          • initWithConfiguration
          • initWithConfigurationAndCallback
          • reconfigureUsingConfiguration
          • configureDebugScreen
          • createPlacement
          • createRewardedVideoPlacement
          • createInFeedBannerPlacement
          • setCollapsibleBannerOptions
          • inFeedBannerViewWillDisappear
          • reloadPlacement
          • startPlacementAutoReload
          • stopPlacementAutoReload
          • reloadPlacementForced
          • reloadAllInFeedBannerComponents
          • reloadLastInFeedBannerComponent
          • reloadConcreteInFeedBannerComponents
          • getInFeedBannerComponentsCount
          • setBannerSizesForInFeedBannerPlacement
          • cancelReloadingInFeedBannerPlacement
          • countAdSpaceForInFeedBannerPlacement
          • showPlacement
          • setDebugEnabled
          • setDebugShakeEnabled
          • setPlacementContentGravity
          • setNetworkEnabled
          • getDebugInfo
          • setIsChildDirected
          • isNetworkEnabled
          • hasAdForPlacement
          • isFrequencyCapReachedForPlacement
          • preparePromo
          • showPromo
          • showConsentDialogIfNeeded
          • showConsentDialogIfNeededOrRejected
          • editConsent
          • reloadConsent
          • isConsentOptIn
          • setContentTargetingUrl
          • setUserTargeting
          • setContentTargetingUrlForPlacement
          • addAdNetworkForKeywordTargeting
          • removeAdNetworkForKeywordTargeting
          • setTargetingInfo
          • setTargetingInfoForPlacement
          • setMultiContentTargetingUrlsForPlacement
          • addAdNetworkForKeywordTargetingForInFeedBannerPlacement
          • removeAdNetworkForKeywordTargetingForInFeedBannerPlacement
          • setTargetingInfo
          • setTargetingInfoForPlacement
          • addAdNetworkForKeywordTargetingForInFeedBannerPlacement
          • removeAdNetworkForKeywordTargetingForInFeedBannerPlacement
          • setTargetingInfoForInFeedBannerPlacement
          • showUnifiedNativeAdPlacement
          • isTablet
          • maximumBannerSizePortrait
          • maximumBannerSizeLandscape
          • fittingBannerSizesPortrait
          • fittingBannerSizesPortrait
          • muteVideoAds
          • setImpressionListener
          • getAdInfo
          • [Deprecated] setFullscreenAdsMuted
        • Events
          • AATKitHaveAd
          • AATKitNoAds
          • AATKitPauseForAd
          • AATKitResumeAfterAd
          • AATKitShowingEmpty
          • AATKitUserEarnedIncentive
          • AATKitObtainedAdRules
          • AATKitUnknownBundleId
          • AATKitHaveAdOnMultiSizeBanner
          • managedConsentNeedsUserInterface
          • managedConsentCMPFinished
          • managedConsentCMPFailedToLoad
          • managedConsentCMPFailedToShow
          • countedAdSpace
          • countedRequest
          • countedResponse
          • countedImpression
          • countedVimpression
          • countedNimpression
          • countedDirectDealsImpressionForNetwork
          • countedClick
          • didCountImpression
          • onGetAdInfo
      • RNAatkitBanner
        • Properties
          • name
          • size
          • gravity
          • reloadOnStart
          • autoreload
          • visible
          • creativeHistorySize
        • Methods
          • reloadPlacement
          • reloadPlacementForced
        • Events
          • onHaveAd
          • onHaveAdForPlacementWithBannerView
          • onNoAd
          • onPauseForAd
          • onResumeAfterAd
          • onShowingEmpty
          • onCountedAdSpace
          • onCountedRequest
          • onCountedResponse
          • onCountedImpression
          • onCountedVimpression
          • onCountedNimpression
          • onCountedDirectDealsImpressionForNetwork
          • onCountedClick
      • RNAatkitInFeedBanner
        • Properties
          • name
          • reloadOnStart
          • forceCacheConsuming
        • Events
          • onCreate
          • onShowNewAd
          • onNoAd
      • RNAatkitUnifiedNativeAd
        • Properties
          • name
          • reloadOnStart
          • showTestDataForLayout
          • testData
      • Other
        • Configuration JSON
        • RNAatkitAdNetworkOptions
          • RNAatkitAppNexusOptions
          • RNAatkitPubNativeOptions
          • RNAatkitFeedAdOptions
          • RNAatkitAdMobOptions
          • RNAatkitDFPOptions
          • RNAatkitDatonomyOptions
          • RNAatkitSuperAwesomeOptions
            • RNAatkitSuperAwesomeBannerOptions
            • RNAatkitSuperAwesomeInterstitialAdOptions
            • RNAatkitSuperAwesomeRewardedVideOptions
          • RNAatkitGraviteRTBOptions
          • RNAatkitDisplayIOOptions
        • Ad Networks
        • Banner Sizes
        • RNAatkitDebugScreenConfiguration
Powered by GitBook
On this page
  • Import modules
  • Initialize AATKit
  • Add optional networks
  1. Start

Initialization

Import and configure AATKit

PreviousExpoNextApp Tracking Transparency

Last updated 3 months ago

Import modules

There are three modules you can import to use AATKit:

  • RNAatkit – main module which allows to initialize plugin. Also provides API to reload and show interstitial ads.

  • RNAatkitBanner – the banner ad component.

  • RNAatkitNativeAd – the native ad component.

Example of importing modules:

import {
    RNAatkit,
    RNAatkitBanner,
    RNAatkitNativeAd
} from '@addapptr/react-native-aatkit'

Initialize AATKit

Use initWithConfiguration function from RNAatkit module to initialize AATKit. This operation should be run only once during the application lifecycle. You can pass JSON object as the parameter to set desired configuration. You can find all configuration options . Please see the example below where AATKit is initialized with test mode using ID 136:

componentWillMount() {
    RNAatkit.initWithConfiguration({
        testModeAccountID: 136,
        consent: {
            type: RNAatkit.ConsentType_ManagedCMPGoogle
        }
    });
}

Make sure to remove the testModeAccountID from your configuration object before you publish your app to the store. Otherwise, your app will not earn any ad revenue.

Add optional networks

Optional networks are disabled by default. If you want to include them to the build, follow instructions below.

Android

  1. Find node_modules/@addapptr/react-native-aatkit/android/build.gradle file.

  2. Uncomment network dependencies which should be included to the build.

iOS

  1. Find node_modules/@addapptr/react-native-aatkit/RNAatkit.podspec file.

  2. Uncomment network dependencies which should be included to the build.

here