load

fun load(context: Context, adParam: AdParam, type: GfpAdCacheType, callback: GfpAdCacheManager.LoadCallback, autoPrefetchNext: Boolean = true, prefetchCallback: GfpAdCacheManager.PrefetchCallback? = null)

Load an ad response instance cached through prefetch from disk, propagating adParam to the auto-prefetch ad call when autoPrefetchNext is enabled.

Note: adParam does not affect the served cached response itself (the response was filled at prefetch time); it only carries publisher targeting forward into the next prefetch.

Parameters

context

context

adParam

ad parameters used for the next prefetch. AdParam.adUnitId must be set.

type

ad cache type

callback

callback for loading cached adCallResponse

autoPrefetchNext

whether to prefetch the next ad automatically after the current ad response is retrieved

prefetchCallback

callback for auto prefetching. Only used when autoPrefetchNext is true


fun load(context: Context, adUnitId: String, type: GfpAdCacheType, callback: GfpAdCacheManager.LoadCallback, autoPrefetchNext: Boolean = true, prefetchCallback: GfpAdCacheManager.PrefetchCallback? = null)

Deprecated

Use load(context, adParam, ...) instead to propagate publisher targeting to the next prefetch.

Replace with

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

Load an ad response instance cached through GfpAdCacheManager.prefetch from disk. All resources required to load the ad in that response are also cached on disk. You can load the ad directly using com.naver.gfpsdk.GfpAdLoader.loadAd with the returned com.naver.gfpsdk.internal.services.adcall.AdCallResponse.

Parameters

context

context

adUnitId

ad unit ID for ad request

callback

callback for loading cached adCallResponse

autoPrefetchNext

whether to prefetch the next ad automatically after the current ad response is retrieved

prefetchCallback

callback for auto prefetching. Only used when autoPrefetchNext is true