RewardedInterstitialAd

abstract class RewardedInterstitialAd


插頁式獎勵廣告會全螢幕顯示,使用者觀看後可獲得獎勵,且不需要選擇觀看即可顯示。

這種廣告格式與com.google.android.gms.ads.rewarded.RewardedAd不同,因為獎勵廣告需要使用者選擇觀看影片。插頁式廣告不會提供獎勵給使用者,因此與com.google.android.gms.ads.interstitial.InterstitialAd不同。

摘要

公用建構函式

公開函式

abstract Bundle

取得這個 RewardedInterstitialAd 的所有可用廣告中繼資料。

abstract String

傳回廣告單元 ID。

abstract FullScreenContentCallback?

取得這個 RewardedInterstitialAd 的 FullScreenContentCallback。

abstract OnAdMetadataChangedListener?

取得這個 RewardedInterstitialAd 的 OnAdMetadataChangedListener。

abstract OnPaidEventListener?

取得這個 RewardedInterstitialAd 的 OnPaidEventListener。

abstract Long

取得這個 RewardedInterstitialAd 的刊登位置 ID。

abstract ResponseInfo

傳回已載入廣告的相關資訊。

abstract RewardItem

取得已載入插頁式獎勵廣告的獎勵項目。

java-static Unit
load(
    context: Context,
    adUnitId: String,
    adManagerAdRequest: AdManagerAdRequest,
    loadCallback: RewardedInterstitialAdLoadCallback
)

載入 RewardedInterstitialAd。

java-static Unit
load(
    context: Context,
    adUnitId: String,
    adRequest: AdRequest,
    loadCallback: RewardedInterstitialAdLoadCallback
)

載入 RewardedInterstitialAd。

abstract Unit
setFullScreenContentCallback(
    fullScreenContentCallback: FullScreenContentCallback?
)

註冊回呼,廣告顯示及關閉全螢幕內容時叫用。

abstract Unit
setImmersiveMode(immersiveModeEnabled: Boolean)

設定標記,控管是否以沉浸模式顯示這個插頁式獎勵廣告物件。

abstract Unit

註冊回呼,插頁式獎勵廣告的中繼資料變更時叫用。

abstract Unit

註冊回呼,預估這則廣告有收益時叫用。

abstract Unit
setPlacementId(placementId: Long)

設定插頁式獎勵廣告的刊登位置 ID。

abstract Unit

為這個插頁式獎勵廣告設定 ServerSideVerificationOptions。

abstract Unit
show(
    activity: Activity,
    onUserEarnedRewardListener: OnUserEarnedRewardListener
)

顯示插頁式獎勵廣告。

公用建構函式

RewardedInterstitialAd

RewardedInterstitialAd()

公開函式

getAdMetadata

abstract fun getAdMetadata(): Bundle

取得這個 RewardedInterstitialAd 的所有可用廣告中繼資料。如果廣告沒有中繼資料,廣告中繼資料就會空白。廣告中繼資料可能會更新。使用 onAdMetadataChanged 監聽變更。

getAdUnitId

abstract fun getAdUnitId(): String

傳回廣告單元 ID。

getFullScreenContentCallback

abstract fun getFullScreenContentCallback(): FullScreenContentCallback?

取得這個 RewardedInterstitialAd 的 FullScreenContentCallback。

getOnAdMetadataChangedListener

abstract fun getOnAdMetadataChangedListener(): OnAdMetadataChangedListener?

取得這個 RewardedInterstitialAd 的 OnAdMetadataChangedListener。

getOnPaidEventListener

abstract fun getOnPaidEventListener(): OnPaidEventListener?

取得這個 RewardedInterstitialAd 的 OnPaidEventListener。

getPlacementId

abstract fun getPlacementId(): Long

取得這個 RewardedInterstitialAd 的刊登位置 ID。

getResponseInfo

abstract fun getResponseInfo(): ResponseInfo

傳回已載入廣告的相關資訊。

getRewardItem

abstract fun getRewardItem(): RewardItem

取得已載入插頁式獎勵廣告的獎勵項目。

load

java-static fun load(
    context: Context,
    adUnitId: String,
    adManagerAdRequest: AdManagerAdRequest,
    loadCallback: RewardedInterstitialAdLoadCallback
): Unit

載入 RewardedInterstitialAd。

參數
context: Context

背景資訊。

adUnitId: String

廣告單元 ID。

adManagerAdRequest: AdManagerAdRequest

有指定目標資訊的 Google Ad Manager 廣告請求。

loadCallback: RewardedInterstitialAdLoadCallback

插頁式獎勵廣告載入完成時叫用的回呼。

load

java-static fun load(
    context: Context,
    adUnitId: String,
    adRequest: AdRequest,
    loadCallback: RewardedInterstitialAdLoadCallback
): Unit

載入 RewardedInterstitialAd。

參數
context: Context

背景資訊。

adUnitId: String

廣告單元 ID。

adRequest: AdRequest

有指定目標資訊的廣告請求。

loadCallback: RewardedInterstitialAdLoadCallback

插頁式獎勵廣告載入完成時叫用的回呼。

setFullScreenContentCallback

abstract fun setFullScreenContentCallback(
    fullScreenContentCallback: FullScreenContentCallback?
): Unit

註冊回呼,廣告顯示及關閉全螢幕內容時叫用。

setImmersiveMode

abstract fun setImmersiveMode(immersiveModeEnabled: Boolean): Unit

設定標記,控管是否以沉浸模式顯示這個插頁式獎勵廣告物件。請在 show 之前呼叫這個方法。在 show 期間,如果標記設為啟用且系統支援沉浸模式,插頁式廣告就會開啟 SYSTEM_UI_FLAG_IMMERSIVE_STICKY 和 SYSTEM_UI_FLAG_HIDE_NAVIGATION。

setOnAdMetadataChangedListener

abstract fun setOnAdMetadataChangedListener(listener: OnAdMetadataChangedListener?): Unit

註冊回呼,插頁式獎勵廣告的中繼資料變更時叫用。

setOnPaidEventListener

abstract fun setOnPaidEventListener(listener: OnPaidEventListener?): Unit

註冊回呼,預估這則廣告有收益時叫用。

setPlacementId

abstract fun setPlacementId(placementId: Long): Unit

設定插頁式獎勵廣告的刊登位置 ID。

為確保報表記錄刊登位置 ID,請在廣告顯示前呼叫這個方法。

參數
placementId: Long

AdMob 使用者介面針對已設定的刊登位置顯示的長整數。

setServerSideVerificationOptions

abstract fun setServerSideVerificationOptions(
    options: ServerSideVerificationOptions!
): Unit

為這個插頁式獎勵廣告設定 ServerSideVerificationOptions。

顯示

abstract fun show(
    activity: Activity,
    onUserEarnedRewardListener: OnUserEarnedRewardListener
): Unit

顯示插頁式獎勵廣告。

參數
activity: Activity

應顯示獎勵廣告的活動。

onUserEarnedRewardListener: OnUserEarnedRewardListener

使用者獲得獎勵時,系統會通知這個監聽器。