Skip to content

Specifying banner loading behaviour

rprunskas edited this page Apr 27, 2018 · 2 revisions

Specifying banner loading behaviour 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 behaviour, it may solve your problem. Available values:

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

By default INSTANT behaviour is used.

You can change loading behaviour like this:

    AdformSDK.setBannerLoadingBehaviour(BannerLoadingBehaviour.BANNER_LOADING_BEHAVIOUR_WAIT_FOR_PAGE_SHOW_EVENT);
Clone this wiki locally