Specifying banner loading behaviour - adform/adform-ios-sdk GitHub Wiki

Specifying banner loading behavior for ad views

Ad views can use several methods to track the end of ad creative loading in a webview. These methods include webview delegate callbacks and listening to various javascript events. The method that you choose to use may influence banner loading time and animation quality. Therefore, if you are experiencing ad loading issues like long loading times or no ad loading delegate callbacks try to use different banner loading behavior, it may solve your problem. Available values:

  • AFBannerLoadingBehaviourInstant - SDK doesn't wait for any JS event indicating that banner has finished loading and decides based on web view delegate callback.
  • AFBannerLoadingBehaviourWaitForLoadEvent - SDK waits for 'load' JS event to detect the end of banner loading.
  • AFBannerLoadingBehaviourWaitForPageshowEvent - SDK waits for 'pageshow' JS event to detect the end of banner loading.
  • AFBannerLoadingBehaviourWaitForDOMContentLoadedEvent - SDK waits for 'DOMContentLoaded' JS event to detect the end of banner loading.

By default AFBannerLoadingBehaviourWaitForPageshowEvent behaviour is used.

You can change loading behavior like this:

Swift

AdformSDK.setBannerLoadingBehaviour(.waitForDOMContentLoadedEvent)
Objective-C
[AdformSDK setBannerLoadingBehaviour:AFBannerLoadingBehaviourWaitForDOMContentLoadedEvent];
⚠️ **GitHub.com Fallback** ⚠️