안드로이드 보상형 광고
Last updated
Last updated
노출을 종료한다면, 네이티브 광고가 garbage collection 되도록 다음과 같이 destroy해야합니다.
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()
AdropRewardedAd rewardedAd = new AdropRewardedAd(context, "YOUR_UNIT_ID");
rewardedAd.setRewardedAdListener(new AdropRewardedAdListener() {
@Override
public void onAdReceived(@NotNull AdropRewardedAd ad) {
Log.d("ADROP", "rewarded ad received " + ad.unitId);
ad.show();
}
@Override
public void onAdFailedToReceive(@NotNull AdropRewardedAd ad, @NotNull AdropErrorCode errorCode) {
Log.d("ADROP", "failed to received " + errorCode);
}
@Override
public void onAdFailedToShowFullScreen(@NotNull AdropRewardedAd ad, @NotNull AdropErrorCode errorCode) {
Log.d("ADROP", "failed to show full screen " + errorCode);
}
...
});
rewardedAd.load();
rewardedAd.destroy()
rewardedAd.destroy();