Amazon_Android_Banner_AutoRefresh - imobile/app-mediation GitHub Wiki

※以下の文書はAmazon Publisher ServicesのドキュメントをAmazonの許諾を得て転載したものです。

Auto Refresh of Ads

The ads can be auto-refreshed by setting the following property on DTBAdRequest. The default value is 60 seconds:

loader.setAutoRefresh();

If you want to use custom durations for auto refresh, provide value in seconds (say 45 seconds) as follows. The minimum auto refresh time supported is 20 seconds. Anything lower than 20 seconds will fall back to our default 60 seconds:

loader.setAutoRefresh(45);

Don’t forget to stop auto refresh. Recommended places for stopping auto refresh are the Activity’s onStop() and onDestroy() event listeners. Please note that improper handling of auto refresh may result in impression discrepancy.

loader.stop();

Note:

  • It is important to stop auto refresh of ads and clean up resources of DTBAdLoader. Auto refresh of ads will continue if it is not stopped explicitly and can cause unwanted behaviors and low impression counts.
  • Set property of auto refresh before loadAd() call. A single instance of DTBAdLoader can be used only for one loadAd() call, and cannot be reused once stop() is called.
  • You should avoid initiating new adViews in the onSuccess() and onFailure() callback. This may result in memory leak, since the views are stacked on top of each other. You can consider clearing the views before adding new views.
  • It is recommended to disable auto refresh of ads provided by your ad server to avoid conflicts with DTB auto-refresh.