6. Calling the ad formats
Every ad call takes a placeholder — a string key configured against an ad format in the AKS portal (e.g. "1"). AKS resolves the placeholder to a primary ad network plus a failover list at runtime; you never reference an ad-unit ID directly in code.
Interstitial
// Load only
AdsManager.loadInterstitial(context, placeholder, object : AdsCallback() {
override fun onLoaded() { }
override fun onFailedToLoad() { }
override fun onAdShown() { }
override fun onAdDismissed() { }
override fun onAdFailedToShow() { }
})
// Show a previously loaded interstitial
AdsManager.showInterstitial(activity, placeholder, callback)
// Load and show in one call
AdsManager.loadAndShowInterstitialAd(activity, placeholder, callback)
// Check availability before showing
AdsManager.isInterstitialAvailable(placeholder)Rewarded
AdsManager.loadRewarded(context, placeholder, object : RewardedAdCallbacks() {
override fun onRewardedLoaded() { }
override fun onRewardedAdLoadFailure() { }
override fun onRewardedCompleted() { }
override fun onAdRewarded() { }
override fun onAdRewardedAdDismissed() { }
override fun onRewardedFailedToShow() { }
})
AdsManager.showRewarded(activity, placeholder, callbacks)
// Load and show in one call — simpler success/fail callback
AdsManager.loadAndShowRewardedAd(activity, placeholder, object : RewardedLoadAndShowCallback {
override fun onRewardedAdSuccess() { }
override fun onRewardedAdFailed() { }
})
AdsManager.isRewardedAvailable(placeholder)App Open
AdsManager.loadAppOpen(application, placeholder, object : AppOpenAdCallbacks() {
override fun onLoaded() { }
override fun onFailedToLoad() { }
override fun onDismiss() { }
override fun onAdShown() { }
override fun onAdFailToShow() { }
})
AdsManager.showAppOpen(activity, placeholder, callbacks)If you want AKS's own splash/app-open handling (driven by the
isAppOpenAtApplicationLvlremote-config flag) instead of managing App Open yourself, useloadDefaultAppOpen/showDefaultAppOpenon yourAppsKitSDKApplicationsubclass — or simply callrequestSplashAppOpenAd(callbacks, addInDefaultDelay), which the baseApplicationclass already implements end-to-end.
Banner
AdsManager.loadBanner(context, placeholder, object : BannerCallback() {
override fun onBannerLoaded() { }
override fun onBannerFailedToLoad() { }
override fun onBannerClicked() { }
override fun onBannerShown() { }
override fun onBannerSizeChanged(bannerSizes: BannerSizes) { }
override fun setBannerSize(width: Double, height: Double) { }
})
// layout is a FrameLayout (BannerContainer) you've placed in your screen
AdsManager.showBanner(activity, layout, placeholder, callback)BannerSizes: BANNER (320×50), LARGE_BANNER (320×100), MEDIUM_RECTANGLE (300×250), FULL_BANNER (468×60).
Native
AdsManager.loadNative(activity, placeholder, isShowInScrollView = false, object : NativeCallback() {
override fun onNativeLoaded() { }
override fun onNativeFailedToLoad() { }
override fun onNativeClicked() { }
override fun onNativeShown() { }
})
// frameLayout is the BannerContainer that will host the native ad view; res is an
// optional custom native-ad layout resource (pass null to use AKS's default layout)
AdsManager.showNative(activity, frameLayout, placeholder, isShowInScrollView = false, res = null, callback)Feature Promotion
Feature Promotion is AKS's own house-ad format for cross-promoting one feature of your app to users who haven't unlocked it yet — it only resolves through the AKS network (not AdMob/MAX/etc.), and the promoted items are configured server-side in the AKS portal, scoped to the placeholder.
// Optional — exclude features the user already has unlocked from being promoted
AdsManager.setFeaturesAvailable(listOf("premium_theme", "no_ads"))
AdsManager.showFeaturePromotion(activity, placeholder, object : OnFeaturePromotionClicked {
override fun onFeaturePromotionClicked(targetScreen: String) {
// user tapped the promotion — navigate them to targetScreen
}
override fun onFailToShowFeaturePromotion(errorMessage: String) { }
})