prefetch

fun prefetch(context: Context, adParam: AdParam, type: GfpAdCacheType, callback: GfpAdCacheManager.PrefetchCallback? = null)

Prefetch and cache response and resources of ad to disk, applying targeting from adParam. The supplied adParam (customParam, keywords, content info, prebid params, etc.) is sent with the prefetch ad call so that the cached response reflects the publisher's targeting.

Cache files are still stored under the ad unit directory; multiple prefetches with different adParam for the same ad unit share the same FIFO bucket. The number of cache files cannot exceed 5 per ad unit. It's recommended to call from a worker thread because it involves file I/O.

Parameters

context

context

adParam

ad parameters for prefetching. AdParam.adUnitId must be set.

type

ad cache type

callback

callback for ad prefetching


fun prefetch(context: Context, adUnitId: String, type: GfpAdCacheType, callback: GfpAdCacheManager.PrefetchCallback? = null)

Deprecated

Use prefetch(context, adParam, type, callback) instead to include publisher targeting parameters.

Replace with

import com.naver.gfpsdk.AdParam
prefetch(context, AdParam.Builder().setAdUnitId(adUnitId).build(), type, callback)

Prefetch and cache response and resources of ad to disk. The number of ad cache files stored on disk cannot exceed 5 per ad unit. It's recommended to call from a worker thread because it involves file I/O.

Parameters

context

context

adUnitId

ad unit ID for ad prefetching

callback

callback for ad prefetching