تبلیغات بینابینی پاداشی نوعی قالب تبلیغاتی تشویقی است که به شما امکان میدهد برای تبلیغاتی که به طور خودکار در حین انتقال طبیعی برنامه ظاهر میشوند، پاداش ارائه دهید. برخلاف تبلیغات پاداشی، کاربران برای مشاهده تبلیغات بینابینی پاداشی نیازی به انتخاب ندارند.
پیشنیازها
- کیت توسعه نرمافزاری تبلیغات موبایلی گوگل (SDK) نسخه ۱۹.۲.۰ یا بالاتر.
- راهنمای شروع به کار را تکمیل کنید.
پیادهسازی
مراحل اصلی برای ادغام تبلیغات بینابینی پاداشدار به شرح زیر است:
- بارگذاری یک تبلیغ
- برای فراخوانی رویدادهای تمام صفحه ثبت نام کنید
- مدیریت فراخوانی پاداش
- نمایش تبلیغ
بارگذاری یک تبلیغ
 بارگذاری یک تبلیغ با استفاده از متد استاتیک load() در کلاس RewardedInterstitialAd انجام میشود. متد load به یک Context، شناسه واحد تبلیغ شما، یک شیء AdManagerAdRequest و یک RewardedInterstitialAdLoadCallback نیاز دارد تا در صورت موفقیت یا عدم موفقیت بارگذاری تبلیغ، به آن اطلاع داده شود. شیء بارگذاری شده RewardedInterstitialAd به عنوان یک پارامتر در فراخوانی onRewardedInterstitialAdLoaded() ارائه میشود.
 مثال زیر نحوه بارگذاری یک RewardedInterstitialAd را در MainActivity شما نشان میدهد. 
جاوا
کاتلین
AD_UNIT_ID با شناسه واحد تبلیغاتی خود جایگزین کنید.
برای تماسهای برگشتی ثبتنام کنید
 برای دریافت اعلانها برای رویدادهای ارائه، باید یک شیء FullScreenContentCallback به تنظیمکنندهی تبلیغ خود ارسال کنید. شیء FullScreenContentCallback فراخوانیهای مجدد را برای زمانی که تبلیغ با موفقیت یا عدم موفقیت ارائه میشود و زمانی که رد میشود، مدیریت میکند. کد زیر نحوهی تنظیم یک شیء ناشناس FullScreenContentCallback را در RewardedInterstitialAdLoadCallback شما نشان میدهد: 
جاوا
    rewardedInterstitialAd.setFullScreenContentCallback(
        new FullScreenContentCallback() {
          @Override
          public void onAdDismissedFullScreenContent() {
            // Called when fullscreen content is dismissed.
            Log.d(TAG, "The ad was dismissed.");
            // Make sure to set your reference to null so you don't
            // show it a second time.
            rewardedInterstitialAd = null;
            if (googleMobileAdsConsentManager.canRequestAds()) {
              loadRewardedInterstitialAd();
            }
          }
          @Override
          public void onAdFailedToShowFullScreenContent(AdError adError) {
            // Called when fullscreen content failed to show.
            Log.d(TAG, "The ad failed to show.");
            // Make sure to set your reference to null so you don't
            // show it a second time.
            rewardedInterstitialAd = null;
          }
          @Override
          public void onAdShowedFullScreenContent() {
            // Called when fullscreen content is shown.
            Log.d(TAG, "The ad was shown.");
          }
          @Override
          public void onAdImpression() {
            // Called when an impression is recorded for an ad.
            Log.d(TAG, "The ad recorded an impression.");
          }
          @Override
          public void onAdClicked() {
            // Called when ad is clicked.
            Log.d(TAG, "The ad was clicked.");
          }
        });
    rewardedInterstitialAd.show(
        MainActivity.this,
        new OnUserEarnedRewardListener() {
          @Override
          public void onUserEarnedReward(@NonNull RewardItem rewardItem) {
            Log.d(TAG, "The user earned the reward.");
            // Handle the reward.
            int rewardAmount = rewardItem.getAmount();
            String rewardType = rewardItem.getType();
          }
        });
  }
  private void initializeMobileAdsSdk() {
    if (isMobileAdsInitializeCalled.getAndSet(true)) {
      return;
    }
    // Set your test devices.
    MobileAds.setRequestConfiguration(
        new RequestConfiguration.Builder()
            .setTestDeviceIds(Arrays.asList(TEST_DEVICE_HASHED_ID))
            .build());
    new Thread(
            () -> {
              // Initialize the Google Mobile Ads SDK on a background thread.
              MobileAds.initialize(this, initializationStatus -> {});
              // Load an ad on the main thread.
              runOnUiThread(() -> loadRewardedInterstitialAd());
            })
        .start();
  }
}
کاتلین
rewardedInterstitialAd?.fullScreenContentCallback =
  object : FullScreenContentCallback() {
    override fun onAdDismissedFullScreenContent() {
      // Called when fullscreen content is dismissed.
      Log.d(TAG, "Ad was dismissed.")
      // Don't forget to set the ad reference to null so you
      // don't show the ad a second time.
      rewardedInterstitialAd = null
    }
    override fun onAdFailedToShowFullScreenContent(adError: AdError) {
      // Called when fullscreen content failed to show.
      Log.d(TAG, "Ad failed to show.")
      // Don't forget to set the ad reference to null so you
      // don't show the ad a second time.
      rewardedInterstitialAd = null
    }
    override fun onAdShowedFullScreenContent() {
      // Called when fullscreen content is shown.
      Log.d(TAG, "Ad showed fullscreen content.")
    }
    override fun onAdImpression() {
      // Called when an impression is recorded for an ad.
      Log.d(TAG, "Ad recorded an impression.")
    }
    override fun onAdClicked() {
      // Called when an ad is clicked.
      Log.d(TAG, "Ad was clicked.")
    }
  }
نمایش تبلیغ
 وقتی یک تبلیغ بینابینی جایزهدار نمایش میدهید، از یک شیء OnUserEarnedRewardListener برای مدیریت رویدادهای جایزه استفاده میکنید. 
جاوا
rewardedInterstitialAd.show(
    MainActivity.this,
    new OnUserEarnedRewardListener() {
      @Override
      public void onUserEarnedReward(@NonNull RewardItem rewardItem) {
        Log.d(TAG, "The user earned the reward.");
        // Handle the reward.
        int rewardAmount = rewardItem.getAmount();
        String rewardType = rewardItem.getType();
      }
    });
کاتلین
rewardedInterstitialAd?.show(this) { rewardItem ->
  Log.d(TAG, "User earned the reward.")
  // Handle the reward.
  val rewardAmount = rewardItem.amount
  val rewardType = rewardItem.type
}
مثالها در گیتهاب
مراحل بعدی
مباحث زیر را بررسی کنید: