안드로이드 보상형 광고

보상형 광고 노출하기

val rewardedAd = AdropRewardedAd(context, "YOUR_UNIT_ID")
rewardedAd.rewardedAdListener = object : AdropRewardedAdListener {
    override fun onAdReceived(ad: AdropRewardedAd) {
        Log.d("ADROP", "rewarded ad received ${ad.unitId}")
        ad.show()
    }
    
    override fun onAdFailedToReceive(ad: AdropRewardedAd, errorCode: AdropErrorCode) {
        Log.d("ADROP", "failed to receive $errorCode")
    }
    
    override fun onAdFailedToShowFullScreen(ad: AdropRewardedAd, errorCode: AdropErrorCode) {
        Log.d("ADROP", "failed to show full screen $errorCode")
    }
    ...
}
rewardedAd.load()

보상형 광고 Destroy

AdropRewardedAd 노출을 종료한다면, 네이티브 광고가 garbage collection 되도록 다음과 같이 destroy해야합니다.

rewardedAd.destroy()

Last updated