@addapptr/aatkit-ionic-plugin v1.0.0-beta6
aatkit-ionic-plugin
AATKit SDK plugin for Ionic
Install
npm install @addapptr/aatkit-ionic-plugin
npx cap sync
API
initialize(...)
reconfigure(...)
setCollapsibleBannerOptions(...)
setLogLevel(...)
setIsChildDirected(...)
configureDebugScreen(...)
enableDebugScreen()
disableDebugScreen()
showConsentDialogIfNeeded()
showConsentDialogIfNeededOrRejected(...)
editConsent()
reloadConsent()
createPlacement(...)
createRewardedVideoPlacement(...)
createAppOpenAdPlacement(...)
reloadPlacement(...)
startPlacementAutoReload(...)
stopPlacementAutoReload(...)
showPlacement(...)
addPlacementToView(...)
removePlacementFromView(...)
setPlacementAlignment(...)
isTablet()
maximumBannerSizeLandscape()
maximumBannerSizePortrait()
fittingBannerSizesPortrait()
fittingBannerSizesLandscape()
setNetworkEnabled(...)
isNetworkEnabled(...)
setContentGravity(...)
addAdNetworkForKeywordTargeting(...)
removeAdNetworkForKeywordTargeting(...)
setTargetingInfo(...)
setTargetingInfoForPlacement(...)
setContentTargetingUrl(...)
setContentTargetingUrlForPlacement(...)
setMultiContentTargetingUrlsForPlacement(...)
setPublisherProvidedId(...)
hasAdForPlacement(...)
isFrequencyCapReachedForPlacement(...)
muteVideoAds(...)
isConsentOptIn()
- Interfaces
initialize(...)
initialize(options: AATKitConfiguration) => Promise<void>
Initializes the AATKit library. Should be called once during application initialization before any other calls to AATKit.
Param | Type |
---|---|
options | AATKitConfiguration |
reconfigure(...)
reconfigure(options: AATKitRuntimeConfiguration) => Promise<void>
Update AATKit consent arguments after the AATKit is already initialized.
Param | Type |
---|---|
options | AATKitRuntimeConfiguration |
setCollapsibleBannerOptions(...)
setCollapsibleBannerOptions(_: { placementName: string; collapsibleBannerOptions: AATKitCollapsibleBannerOptions; }) => Promise<void>
Allows to set collapsible banner options for given placement
Param | Type | Description |
---|---|---|
_ | { placementName: string; collapsibleBannerOptions: AATKitCollapsibleBannerOptions; } | Contains placement name and collapsible banner options |
setLogLevel(...)
setLogLevel(options: { level: string; }) => Promise<void>
Allows to set log level from code.
Param | Type | Description |
---|---|---|
options | { level: string; } | Allows to set log level from code. Possible values of the level: "debug", "error", "info", "verbose", "warn" |
setIsChildDirected(...)
setIsChildDirected(options: { isChildDirected: boolean; }) => Promise<void>
Allows to set if app should be treated as child-directed.
Param | Type | Description |
---|---|---|
options | { isChildDirected: boolean; } | isChildDirected – True if app is child directed, false otherwise. |
configureDebugScreen(...)
configureDebugScreen(configuration: AATKitDebugScreenConfiguration) => Promise<void>
Sets debug screen configuration.
Param | Type |
---|---|
configuration | AATKitDebugScreenConfiguration |
enableDebugScreen()
enableDebugScreen() => Promise<void>
Enables debug screen that will show after shaking the device. It is already enabled by default.
disableDebugScreen()
disableDebugScreen() => Promise<void>
Disables the debug screen appearing after shaking the device. It is enabled by default.
showConsentDialogIfNeeded()
showConsentDialogIfNeeded() => Promise<void>
Presents the consent screen only if it is required by the used CMP (for example if no user consent has been set yet). It is advised to always call this method when the app starts.
showConsentDialogIfNeededOrRejected(...)
showConsentDialogIfNeededOrRejected(options: { daysAgo: number; }) => Promise<void>
Presents the consent screen if it is required by the used CMP (i.e. no user consent has been set yet) or the user has rejected the consent.
Param | Type |
---|---|
options | { daysAgo: number; } |
editConsent()
editConsent() => Promise<void>
Presents the consent screen, allowing the user to change consent settings.
reloadConsent()
reloadConsent() => Promise<void>
Tells the CMP to reload. Does not need to be used unless some error occurs.
createPlacement(...)
createPlacement(options: { placementName: string; placementSize: string; }) => Promise<void>
Creates placement with given name and size and adds it to the view.
Param | Type | Description |
---|---|---|
options | { placementName: string; placementSize: string; } | object containing placement name and its size. Possible values of the size: "Fullscreen", "Banner320x53", "Banner320x50", "Banner768x90", "Banner300x250", "Banner468x60" |
createRewardedVideoPlacement(...)
createRewardedVideoPlacement(options: { placementName: string; }) => Promise<void>
Creates Rewarded Video placement with given name.
Param | Type | Description |
---|---|---|
options | { placementName: string; } | object containing placement name. |
createAppOpenAdPlacement(...)
createAppOpenAdPlacement(options: { placementName: string; }) => Promise<void>
Creates a new App Open Ad with given name.
Param | Type | Description |
---|---|---|
options | { placementName: string; } | object containing placement name. |
reloadPlacement(...)
reloadPlacement(options: { placementName: string; }) => Promise<boolean>
Requests placement reload. Works only if automatic reloading is disabled.
Param | Type | Description |
---|---|---|
options | { placementName: string; } | object containing placement name. |
Returns: Promise<boolean>
startPlacementAutoReload(...)
startPlacementAutoReload(options: { placementName: string; }) => Promise<void>
Enables automatic reloading of placement. Auto-reloader will use reload time configured on gravite.net account or fallback to default 30L seconds.
Param | Type | Description |
---|---|---|
options | { placementName: string; } | object containing placement name. |
stopPlacementAutoReload(...)
stopPlacementAutoReload(options: { placementName: string; }) => Promise<void>
Disables automatic reloading of placement.
Param | Type | Description |
---|---|---|
options | { placementName: string; } | object containing placement name. |
showPlacement(...)
showPlacement(options: { placementName: string; }) => Promise<boolean>
Shows interstitial ad if ad is ready.
Param | Type | Description |
---|---|---|
options | { placementName: string; } | object containing placement name. |
Returns: Promise<boolean>
addPlacementToView(...)
addPlacementToView(options: { placementName: string; }) => Promise<void>
Adds placement to view. Works only for banner placements.
Param | Type | Description |
---|---|---|
options | { placementName: string; } | object containing placement name. |
removePlacementFromView(...)
removePlacementFromView(options: { placementName: string; }) => Promise<void>
Removes placement from view. Works only for banner placements.
Param | Type | Description |
---|---|---|
options | { placementName: string; } | object containing placement name. |
setPlacementAlignment(...)
setPlacementAlignment(options: { placementName: string; bannerAlignment: string; }) => Promise<void>
Sets banner placement position on the screen.
Param | Type | Description |
---|---|---|
options | { placementName: string; bannerAlignment: string; } | object containing placement name and banner alignment with possible values: "topLeft", "topCenter", "topRight", "bottomLeft", "bottomCenter", "bottomRight" |
isTablet()
isTablet() => Promise<boolean>
Checks if AATKit recognizes given device as tablet.
Returns: Promise<boolean>
maximumBannerSizeLandscape()
maximumBannerSizeLandscape() => Promise<String>
Returns the banner size with maximum width that will fit on a given device in portrait screen orientation.
Returns: Promise<String>
maximumBannerSizePortrait()
maximumBannerSizePortrait() => Promise<String>
Returns the banner size with maximum width that will fit on a given device in portrait screen orientation.
Returns: Promise<String>
fittingBannerSizesPortrait()
fittingBannerSizesPortrait() => Promise<string[]>
Returns the list of baner sizes that will fit on a given device in portrait screen orientation.
Returns: Promise<string[]>
fittingBannerSizesLandscape()
fittingBannerSizesLandscape() => Promise<string[]>
Returns the list of BannerSize that will fit on a given device in landscape screen orientation.
Returns: Promise<string[]>
setNetworkEnabled(...)
setNetworkEnabled(options: { network: string; enabled: boolean; }) => Promise<void>
Allows to enable or disable selected ad networks. By default all networks are enabled
Param | Type | Description |
---|---|---|
options | { network: string; enabled: boolean; } | Contains network name and enabled value – True to enable, false to disable. |
isNetworkEnabled(...)
isNetworkEnabled(options: { network: string; }) => Promise<boolean>
Returns true if ad network is enabled, false otherwise.
Param | Type | Description |
---|---|---|
options | { network: string; } | Contains network name. |
Returns: Promise<boolean>
setContentGravity(...)
setContentGravity(options: { placementName: string; gravity: string; }) => Promise<void>
Sets gravity for ads that don't fill entire placement area.
Param | Type | Description |
---|---|---|
options | { placementName: string; gravity: string; } | Contains placement name and gravity value of "top", "bottom" or "center". |
addAdNetworkForKeywordTargeting(...)
addAdNetworkForKeywordTargeting(options: { network: string; }) => Promise<void>
Adds an ad network to the list of ad networks that receive targeting keywords (if any set). If no ad networks are added, any set keywords will be delivered to all ad networks supporting keyword targeting.
Param | Type | Description |
---|---|---|
options | { network: string; } | Contains network name. |
removeAdNetworkForKeywordTargeting(...)
removeAdNetworkForKeywordTargeting(options: { network: string; }) => Promise<void>
Removes an ad network from the list of ad networks that receive targeting keywords (if any set). If no ad networks are added to the list, any set keywords will be delivered to all ad networks supporting keyword targeting.
Param | Type | Description |
---|---|---|
options | { network: string; } | Contains network name. |
setTargetingInfo(...)
setTargetingInfo(options: { info: { [key: string]: string[]; }; }) => Promise<void>
Sets the targeting information for the application. This information will be used only if no placement-specific targeting is available.
Param | Type | Description |
---|---|---|
options | { info: { key: string: string[]; }; } | Contains targeting info. |
setTargetingInfoForPlacement(...)
setTargetingInfoForPlacement(options: { placementName: string; info: { [key: string]: string[]; }; }) => Promise<void>
Sets the targeting information for the specific placement.
Param | Type | Description |
---|---|---|
options | { placementName: string; info: { key: string: string[]; }; } | Contains placement name and targeting info. |
setContentTargetingUrl(...)
setContentTargetingUrl(options: { url: string; }) => Promise<void>
Sets the content targeting url for the application. This information will be used only if no placement-specific targeting is available.
Param | Type | Description |
---|---|---|
options | { url: string; } | Contains content url. |
setContentTargetingUrlForPlacement(...)
setContentTargetingUrlForPlacement(options: { placementName: string; url: string; }) => Promise<void>
Sets the content targeting url for the specific placement.
Param | Type | Description |
---|---|---|
options | { placementName: string; url: string; } | Contains placement name and content url. |
setMultiContentTargetingUrlsForPlacement(...)
setMultiContentTargetingUrlsForPlacement(options: { placementName: string; urls: string[]; }) => Promise<void>
Sets the multi content targeting url for the application. Not all ad-networks supports multiple urls.
Param | Type | Description |
---|---|---|
options | { placementName: string; urls: string[]; } | Contains placement name and the list of urls. |
setPublisherProvidedId(...)
setPublisherProvidedId(options: { publisherProvidedId: string; }) => Promise<void>
Allows to pass PublisherProvidedId to networks supporting it.
Param | Type | Description |
---|---|---|
options | { publisherProvidedId: string; } | Contains publisher provided ID |
hasAdForPlacement(...)
hasAdForPlacement(options: { placementName: string; }) => Promise<boolean>
Returns true if there is an ad loaded for given placement.
Param | Type | Description |
---|---|---|
options | { placementName: string; } | Contains placement name. |
Returns: Promise<boolean>
isFrequencyCapReachedForPlacement(...)
isFrequencyCapReachedForPlacement(options: { placementName: string; }) => Promise<boolean>
Checks if desired impression cap (set on Gravite Dashboard) is reached for given fullscreen or rewarded video placement. Note: this method will ALWAYS return false for other placement types.
Param | Type | Description |
---|---|---|
options | { placementName: string; } | Contains placement name. |
Returns: Promise<boolean>
muteVideoAds(...)
muteVideoAds(options: { mute: boolean; }) => Promise<void>
Allows to mute video ads.
Param | Type | Description |
---|---|---|
options | { mute: boolean; } | True to enable, false to disable ad muting. |
isConsentOptIn()
isConsentOptIn() => Promise<boolean>
Returns "consent opt-in status" returned by our server rules. Only returns meaningful information after the rules are downloaded.
Returns: Promise<boolean>
Interfaces
AATKitConfiguration
Prop | Type |
---|---|
alternativeBundleId | string |
initialRules | string |
shouldCacheRules | boolean |
shouldSkipRules | boolean |
shouldReportUsingAlternativeBundleId | boolean |
testModeAccountId | number |
useDebugShake | boolean |
platform | string |
consent | AATKitConsent |
adNetworkOptions | AATKitAdNetworkOptions |
AATKitConsent
Prop | Type |
---|---|
type | string |
nonIABConsent | string |
vendorConsentObtainedNetworks | string[] |
noConsentNetworkStopSet | string[] |
consentForAddapptr | string |
showIfNeededSetting | string |
accountId | number |
propertyId | number |
propertyName | string |
pmId | string |
AATKitAdNetworkOptions
Prop | Type |
---|---|
appNexusOptions | AATKitAppNexusOptions |
feedAdOptions | AATKitFeedAdOptions |
adMobOptions | AATKitAdMobOptions |
dfpOptions | AATKitDFPOptions |
datonomyOptions | AATKitDatonomyOptions |
superAwesomeOptions | AATKitSuperAwesomeOptions |
AATKitAppNexusOptions
Prop | Type |
---|---|
autoCloseTime | number |
supportNativeBanner | boolean |
supportVideoBanner | boolean |
AATKitFeedAdOptions
Prop | Type |
---|---|
shutterColor | number |
disableSpinner | boolean |
AATKitAdMobOptions
Prop | Type |
---|---|
inlineBannerMaxHeight | number |
AATKitDFPOptions
Prop | Type |
---|---|
inlineBannerMaxHeight | number |
AATKitDatonomyOptions
Prop | Type |
---|---|
datonomyAPIKey | string |
AATKitSuperAwesomeOptions
Prop | Type |
---|---|
bannerOptions | AATKitSuperAwesomeBannerOptions |
interstitialAdOptions | AATKitSuperAwesomeInterstitialAdOptions |
rewardedVideoOptions | AATKitSuperAwesomeRewardedVideOptions |
AATKitSuperAwesomeBannerOptions
Prop | Type |
---|---|
parentalGateEnabled | boolean |
bumperPageEnabled | boolean |
bumperPageCustomAppName | string |
AATKitSuperAwesomeInterstitialAdOptions
Prop | Type | Description |
---|---|---|
orientation | string | Possible values: "any", "portrait", "landscape" |
closeButtonState | string | Possible values: "enabled", "enablednodelay", "disabled" |
AATKitSuperAwesomeRewardedVideOptions
Prop | Type |
---|---|
closeButtonAtEnd | boolean |
smallClickEnabled | boolean |
closeButtonWarningEnabled | boolean |
AATKitRuntimeConfiguration
Prop | Type |
---|---|
consentRequired | boolean |
useGeoLocation | boolean |
AATKitCollapsibleBannerOptions
Prop | Type |
---|---|
minDelayInSeconds | number |
position | string |
AATKitDebugScreenConfiguration
Prop | Type |
---|---|
title | string |
showBundleId | boolean |
showTestMode | boolean |
showLoadedAndLoadingAds | boolean |
showAvailableNetworks | boolean |
showDisabledNetworks | boolean |
showRemovedNetworkSDKs | boolean |
showUnsupportedNetworks | boolean |
showExtraSDKs | boolean |
showConsent | boolean |
showAdvertisingId | boolean |
showDeviceType | boolean |
String
Allows manipulation and formatting of text strings and determination and location of substrings within strings.
Prop | Type | Description |
---|---|---|
length | number | Returns the length of a String object. |
Method | Signature | Description |
---|---|---|
toString | () => string | Returns a string representation of a string. |
charAt | (pos: number) => string | Returns the character at the specified index. |
charCodeAt | (index: number) => number | Returns the Unicode value of the character at the specified location. |
concat | (...strings: string[]) => string | Returns a string that contains the concatenation of two or more strings. |
indexOf | (searchString: string, position?: number | undefined) => number | Returns the position of the first occurrence of a substring. |
lastIndexOf | (searchString: string, position?: number | undefined) => number | Returns the last occurrence of a substring in the string. |
localeCompare | (that: string) => number | Determines whether two strings are equivalent in the current locale. |
match | (regexp: string | RegExp) => RegExpMatchArray | null | Matches a string with a regular expression, and returns an array containing the results of that search. |
replace | (searchValue: string | RegExp, replaceValue: string) => string | Replaces text in a string, using a regular expression or search string. |
replace | (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string) => string | Replaces text in a string, using a regular expression or search string. |
search | (regexp: string | RegExp) => number | Finds the first substring match in a regular expression search. |
slice | (start?: number | undefined, end?: number | undefined) => string | Returns a section of a string. |
split | (separator: string | RegExp, limit?: number | undefined) => string[] | Split a string into substrings using the specified separator and return them as an array. |
substring | (start: number, end?: number | undefined) => string | Returns the substring at the specified location within a String object. |
toLowerCase | () => string | Converts all the alphabetic characters in a string to lowercase. |
toLocaleLowerCase | (locales?: string | string[] | undefined) => string | Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. |
toUpperCase | () => string | Converts all the alphabetic characters in a string to uppercase. |
toLocaleUpperCase | (locales?: string | string[] | undefined) => string | Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. |
trim | () => string | Removes the leading and trailing white space and line terminator characters from a string. |
substr | (from: number, length?: number | undefined) => string | Gets a substring beginning at the specified location and having the specified length. |
valueOf | () => string | Returns the primitive value of the specified object. |
RegExpMatchArray
Prop | Type |
---|---|
index | number |
input | string |
RegExp
Prop | Type | Description |
---|---|---|
source | string | Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. |
global | boolean | Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. |
ignoreCase | boolean | Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. |
multiline | boolean | Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. |
lastIndex | number |
Method | Signature | Description |
---|---|---|
exec | (string: string) => RegExpExecArray | null | Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search. |
test | (string: string) => boolean | Returns a Boolean value that indicates whether or not a pattern exists in a searched string. |
compile | () => this |
RegExpExecArray
Prop | Type |
---|---|
index | number |
input | string |
2 months ago
2 months ago
3 months ago
5 months ago
6 months ago
8 months ago
8 months ago