Wiki

Clone wiki

Cordova Plugin / Home

This documentation is deprecated

Please see here for up-to-date documentation.

Introduction

Sign Up

To use the AddApptr SDK, please sign up for an account.

Changelog

Sample App

General integration instructions

Installation

#!
cordova plugin add @addapptr/aatkit-cordova-plugin

Additional steps

It's recommended to use multidex for Android platform. Otherwise you might not be able to build your project. To install it, please execute this command in your project directory.

#!
cordova plugin add cordova-plugin-enable-multidex && cordova plugin add cordova-plugin-androidx

Initialize AATKit

Use initWithConfiguration function 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. Please see the example below where AATKit is initialized with test mode using ID 74:

#!javascript

AATKitCordova.initWithConfiguration({
    "testModeAccountId": 74
});

Adding optional networks

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

Android

  1. Find plugins/aatkit-cordova-plugin/src/android/aatkit-cordova-plugin.gradle file.
  2. Comment out network dependencies which should be indluced to the build.

App Tracking Transparency & iOS 14.5

Starting with iOS 14.5 publishers have to use the App Tracking Transparency framework when accessing the IDFA. This is why you should present the app-tracking authorization request to the end user. It can be achieved for example by using cordova-plugin-idfa.

GDPR - General Data Protection Regulation

Using the CMP through AddApptr provided wrapper

With the introduction of IAB TCF2.0, AddApptr will no longer act as a CMP. Instead, we provide wrappers allowing for easily integrating third-party CMPs. Please note that the CMPs need a server-side configuration, please contact support@addapptr.com if you need support.

There are following functions for Managed Consent:

There are following events related to Managed Consent:

CMP Implementations

For now, we provide two CMP implementations:

CMP Google

Android requires appId to be added to Manifest, like

#!javascript
<meta-data
          android:name="com.google.android.gms.ads.APPLICATION_ID"
          android:value="YOUR-APP-ID"/>

For iOS you need to set the GADApplicationIdentifier value to the Info.plist file, like:

#!javascript
<key>GADApplicationIdentifier</key>
<string>YOUR-APP-ID</string>

Code example:

#!javascript
AATKitCordova.initWithConfiguration({
    "consent": {
        "type": "managedCMPGoogle"
    }
});
CMP Ogury

Requires Asset Key as configuration parameter when initializing AATKit.

Code example:

#!javascript
AATKitCordova.initWithConfiguration({
    "consent": {
        "type": "managedCMPOgury"
    }
});

Not using the AddApptr CMP wrapper

If for some reason you do not want to use AddApptr CMP wrappers, AATKit also provides another methods for GDPR compliance. The consentRequired configuration parameter allows you to inform AATKit if the user is subject to the GDPR laws:

#!javascript
AATKitCordova.initWithConfiguration({
    "consentRequired": true
});

For publishers not using the Managed Consent, we have introduced another type of Consent for GDPR-compliance, allowing to pass network-specific consent status. To use it, you need to initialize AATKit with consent type set as vendor. Also you should pass the list of networks which should have consent set as obtained. AATKit will set consent as withheld for another networks.

#!javascript
AATKitCordova.initWithConfiguration({
    "consent": {
        "type": "vendor",
        "consentForAddapptr": "obtained",
        "vendorConsentObtainedNetworks": ["adcolony", "dfp", "unityads"]
    }
});

To define if the user has given or withheld consent for the collection and use of personal data (used for non-IAB partners) set configuration type parameter as simpleConsent and use nonIABConsent parameter as:

  • "obtained" if the user has given the consent.
  • "withheld" if the user has declined.

If Simple Consent is used, it will automatically read the IAB Consent String stored (by third-party CMP) in SharedPreferences (if available).

#!javascript
AATKitCordova.initWithConfiguration({
    "consent": {
        "type": "simpleconsent",
        "nonIABConsent": "obtained"
    }
});

Adding placements

Banner ads

Fullscreen ads

Rewarded ads

API

Functions

initWithConfiguration

reconfigure

getVersion

showConsentDialogIfNeeded

editConsent

reloadConsent

setDebugEnabled

setDebugShakeEnabled

getDebugInfo

setNetworkEnabled

isNetworkEnabled

createPlacement

createRewardedVideoPlacement

createAppOpenAdPlacement

reloadPlacement

reloadPlacementForced

startPlacementAutoReload

stopPlacementAutoReload

muteVideoAds

hasAdForPlacement

isFrequencyCapReachedForPlacement

addPlacementToView

removePlacementFromView

setPlacementAlignment

setPlacementAlignmentWithOffset

setPlacementPosition

setPlacementContentGravity

showPlacement

setTargetingInfo

setTargetingInfoForPlacement

setContentTargetingUrl

setContentTargetingUrlForPlacement

addAdNetworkForKeywordTargeting

removeAdNetworkForKeywordTargeting

setPublisherProvidedId

isTablet

maximumBannerSizePortrait

maximumBannerSizeLandscape

fittingBannerSizesPortrait

fittingBannerSizesLandscape

Events

aatkitHaveAd

aatkitNoAd

aatkitShowingEmpty

aatkitPauseForAd

aatkitResumeAfterAd

aatkitUserEarnedIncentive

aatkitObtainedAdRules

managedConsentNeedsUserInterface

managedConsentCMPFinished

managedConsentCMPFailedToLoad

managedConsentCMPFailedToShow

Statistics Events

countedAdSpace

countedRequest

countedResponse

countedImpression

countedVimpression

countedDirectDealImpression

countedClick

Updated