Best practices
This page gathers the rules that make an integration work reliably. Each one explains what the SDK does, so you know why it matters.
Initialization
Section titled “Initialization”- Initialize the SDK once, at app launch, before loading any ad. An ad requested before the first initialization fails with
SDK_NOT_INITIALIZED. Callinginitializeagain later has no effect. - Call the SDK from the main thread. Initialization and the ad classes work with UIKit and do not switch threads by themselves.
- Set the privacy options before initializing.
WAAdSettings.childDirectedandWAAdSettings.maxAdContentRatingare applied when the SDK starts, so they should not be changed while the app is running. See Privacy.
Consent and privacy
Section titled “Consent and privacy”- Request the user consent on every launch, before the first ad request. The SDK never shows the consent dialog by itself.
request(ifRequired:)only shows it when it is needed, and its completion handler is always called, so it is the right place to continue. See User consent. - If your app requests the App Tracking Transparency authorization, do it after the consent and before loading ads. Requesting it is optional, and the SDK does not show this prompt. See App Tracking Transparency.
- Offer a way to change the consent. Call
WAConsentManager.shared.request(_:)from a settings screen, as it always shows the dialog.
The recommended order at launch is: initialize, request consent, request ATT (if your app does), load ads.
Loading ads
Section titled “Loading ads”- Do not call
loadAd()again when an ad is already available. A new load discards the ad that was ready and requests another one. - Do not retry immediately inside
didFailToLoad. After a failed load, interstitial, rewarded, app open and native ads enter a cooldown (30 seconds by default) and anyloadAd()call made during it is ignored, without invoking the delegate. Schedule the retry instead:
func didFailToLoad(interstitialAd: WAInterstitialAd, error: WAAdError) { let delay = max(interstitialAd.cooldownRemaining, 30)
DispatchQueue.main.asyncAfter(deadline: .now() + delay) { [weak self] in self?.interstitialAd.loadAd() }}- Load the next ad when the current one is dismissed. An interstitial, rewarded or app open ad can only be shown once, so call
loadAd()indidDismissto have the next one ready.
Showing ads
Section titled “Showing ads”- Check
isAvailablebefore callingshowAd(from:). If no ad is available the method returns without showing anything and without invoking the delegate, so the app must not wait fordidDismissordidFailToShowto continue. - Pass a view controller that is on screen and is not presenting another one. Otherwise the ad can not be presented.
- Grant the reward in
didComplete(rewardedAd:reward:).didDismissis also invoked when the user closes the ad without earning the reward.
Banners
Section titled “Banners”- Set
rootViewControllerbefore callingloadAd(). Without it, part of the demand can not be loaded and the banner fills less, or not at all. - Do not call
loadAd()insidedidFailToLoad. The banner retries by itself one minute after a failed load, and each manual call sends a new request. - Create each banner once. Create it when the screen is created (for example, in
viewDidLoad) and not every time it appears, since every new instance sends a new request. - Let the SDK manage the auto-refresh. It is paused automatically while the banner is not visible or the app is in background.
autoRefreshTimeis expressed in seconds, accepts values between 30 and 120, and can be set toWABannerAd.autoRefreshDisabledto turn it off.
App open
Section titled “App open”- Call
loadAd()once after getting the manager.WAAppOpenManagershows an ad when the app becomes active only if one is already loaded. After that first load, it reloads by itself every time an ad is closed. - Start the manager after the consent and ATT prompts. The app also becomes active when a system dialog is closed, so an ad loaded earlier could be shown right after it.
Object lifetime
Section titled “Object lifetime”- Keep a reference to every ad object. It is needed to show the ad later and to destroy it.
- Call
destroy()when an ad is no longer needed. Do it when the screen that owns the ad is closed. A banner, and any interstitial, rewarded or app open ad that has been loaded but not shown, stays in memory until it is destroyed. - Keep the delegate alive.
WABannerAd,WAInterstitialAd,WARewardedAdandWAAppOpenAdhold their delegate weakly: an object created only to act as delegate is released immediately and no event is received. - Release the native ad loader explicitly.
WANativeAdLoaderholds its delegate strongly. When the delegate is the same object that owns the loader, destroy the loader and set the reference tonilwhen the screen is closed, as shown in Native. Destroy everyWANativeAdthat is no longer displayed too.
Testing
Section titled “Testing”- Use test ads while developing. Use the test ad units or enable the test mode, so development does not generate impressions and clicks on real ads.
- Never ship the test mode.
WAAdSettings.testEnabledmakes every request a test request, which generates no revenue. Enable it only in debug builds:
#if DEBUGWAAdSettings.testEnabled = true#endifBefore you publish
Section titled “Before you publish”Info.plistcontains your ownGADApplicationIdentifier(with theca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyyformat), theSKAdNetworkItemslist and, if the app requests the ATT authorization,NSUserTrackingUsageDescription.- The SDK is initialized at launch with the app key of the app, taken from the dashboard.
- The consent is requested before the first ad request, followed by the ATT authorization if the app requests it.
- Every ad uses a production ad unit ID of its own format: no
test-ad unit is left in the code. WAAdSettings.testEnabledis not enabled in release builds.- If the app is directed to children,
childDirectedandmaxAdContentRatingare set before the initialization. - Every banner has its
rootViewControllerassigned. - Every
showAd(from:)call is guarded byisAvailable, and rewards are granted indidComplete. - Every ad is destroyed when the screen that owns it is closed.
- A fresh install of the release build loads and shows every ad format. See Troubleshooting if it does not.
© 2026 Wortise. All rights reserved.