1

Is there any way to find if an ad is available for a user or not, especially for a reward video?

I want to check if an ad is available without loading the ad, and then display a reward button only if the ad is available. Right now I have to load the whole ad before showing reward button to users, which wastes resources because there is no way to know if the user will press the reward button or not.

I want to confirm before showing reward button that there is ad available for the particular user, without loading/caching the full video ad.

1 Answers1

0

Always keep your Video Ad in cache (Available in cache but not shown yet). When you request/load, an Ad fetched from server but not appear in front of user, only appear when you call show() on Ad.

@Override
public boolean showVideoAd(){

     isRewardShown=false;
     activity.runOnUiThread(new Runnable() {
                public void run() {

                    if (mAd.isLoaded()) {
                        mAd.show();
                        isRewardShown=true;

                    } else {
                        loadRewardedVideoAd();
                    }
                }

            });

    return isRewardShown;
}

private void loadRewardedVideoAd() {
    mAd.loadAd("ca-app-pub-3940256099942544/5224354917", new AdRequest.Builder().build());
}

show rewardButton only when mAd.isLoaded(), return true. If User click on rewardButton then call showVideoAd otherwise no problem you have already that Reward video is in cached, may be use for next time.

Abhishek Aryan
  • 19,936
  • 8
  • 46
  • 65
  • 1
    that's what i am right now doing, but i want confirm before loading video... because if user never click video its waste of users Internet Data... – user2873549 Apr 07 '17 at 16:23
  • load ad once, for first time when your app launch, then never load your ad again, if suppose your user is interested in reward video(means some revenue in your pocket) show loaded video to your user and waste some internet data of that and request to load new ad(because each time new loaded ad give you revenue). Another case user not interested in reward video, no problem you've loaded Ad once. – Abhishek Aryan Apr 07 '17 at 16:42
  • @user2873549 that's not possible. If the ad is not available then it will fail to load. Simple as that. – Daniel Storm Apr 09 '17 at 14:06