0

I have Created Admob video rewarded ad. My admob Account is old and I have shown successfully an interstial ad in my another app. But, I have added a new app in admob just and created a admob video. The video is shown fine with test id the admob provided. But when I use my real video rewarded id, the ad loaded failed. For, inqurie I have added test device id.

Is there Something, That I am missing ?

Here is my code, which loaded the test ad id fine, But not real ad id :

import com.google.android.gms.ads.reward.RewardItem;
import com.google.android.gms.ads.reward.RewardedVideoAd;
import com.google.android.gms.ads.reward.RewardedVideoAdListener;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.MobileAds;

 private RewardedVideoAd mRewardedVideoAd;




@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    waitingDialog = new SpotsDialog(MainActivity.this);

    MobileAds.initialize(this, "my_App_ID");



    // Use an activity context to get the rewarded video instance.
    mRewardedVideoAd = MobileAds.getRewardedVideoAdInstance(this);
    mRewardedVideoAd.setRewardedVideoAdListener(this);




    loadRewardedVideoAd();

}


private void loadRewardedVideoAd() {
    mRewardedVideoAd.loadAd("REAL_REAWARDED_VIDEO_ID",
            new AdRequest.Builder().addTestDevice("MY_DEVICE_ID").build());
}


public  void  arabicSearchActivity (View view){

    if (mRewardedVideoAd.isLoaded()) {
        mRewardedVideoAd.show();
    }else {


        Toast.makeText(this, "Slow Internet, Please Click Again", Toast.LENGTH_SHORT).show();

        loadRewardedVideoAd();
    }

}

@Override
protected void onStop() {
    if (waitingDialog!=null&&waitingDialog.isShowing())
        waitingDialog.dismiss();
    super.onStop();
}


@Override
public void onResume() {
    mRewardedVideoAd.resume(this);
    super.onResume();
}

@Override
public void onPause() {
    mRewardedVideoAd.pause(this);
    super.onPause();
}

@Override
public void onDestroy() {
    mRewardedVideoAd.destroy(this);
    super.onDestroy();
}


@Override
public void onRewarded(RewardItem reward) {
    Toast.makeText(this, "onRewarded! currency: " + reward.getType() + "  amount: " +
            reward.getAmount(), Toast.LENGTH_SHORT).show();
    // Reward the user.
    startActivity(new Intent(MainActivity.this,  SearchArabic.class));
}

@Override
public void onRewardedVideoAdLeftApplication() {
    Toast.makeText(this, "onRewardedVideoAdLeftApplication",
            Toast.LENGTH_SHORT).show();
}

@Override
public void onRewardedVideoAdClosed() {
    Toast.makeText(this, "onRewardedVideoAdClosed", Toast.LENGTH_SHORT).show();

    loadRewardedVideoAd();
}

@Override
public void onRewardedVideoAdFailedToLoad(int errorCode) {
    Toast.makeText(this, "Please Check Internet Connections", Toast.LENGTH_LONG).show();
}

@Override
public void onRewardedVideoAdLoaded() {
    Toast.makeText(this, "onRewardedVideoAdLoaded", Toast.LENGTH_SHORT).show();
}

@Override
public void onRewardedVideoAdOpened() {
    Toast.makeText(this, "onRewardedVideoAdOpened", Toast.LENGTH_SHORT).show();
}

@Override
public void onRewardedVideoStarted() {
    Toast.makeText(this, "onRewardedVideoStarted", Toast.LENGTH_SHORT).show();
}

@Override
public void onRewardedVideoCompleted() {
    Toast.makeText(this, "onRewardedVideoCompleted", Toast.LENGTH_SHORT).show();
}
Noor Hossain
  • 1,620
  • 1
  • 18
  • 25

2 Answers2

0

There's nothing specifically on your part that you've left.
When you add a new app to the AdMob console, it becomes newly registered on the database. Means, for its algorithm, your app is new and is not famous enough. To prove that, it requires to get just a few(around 1k-3k) ad show requests from the app to verify that the app is generating live impressions, i.e., it is being used by real users[This was just a real-life example to illustrate].

The point is just that, your app must generate some live impressions for the inventory(ad allocation area) to return an ad for showing in the app. When you have around(max) 5k (least- 1k) ad requests. It will start showing ads.

Gourav
  • 2,746
  • 5
  • 28
  • 45
  • its also Time consuming, I got ad after 4 hours , and after about 50 clicks. But These rules are very tight, because we cant know whether the ad coming or not or whether my codes are fine. – Noor Hossain Aug 03 '19 at 15:40
  • No, that's not unpredictable. Ads will surely come if you set up the codes as they told. Also, if my answer is correct for your needs, then click the green check mark beside it. – Gourav Aug 04 '19 at 03:22
  • yes, I described, 50 to 100 clicks is enough ( this is from my experience), the information in your answer about 1k-3k-5k ,I guess this is not correct. This prevent me to upvote you. – Noor Hossain Aug 04 '19 at 09:33
  • 50-100 clicks are not the matter, please read again. I said 1k-2k request to show ad. – Gourav Aug 04 '19 at 09:58
  • I think 1k = 1000 click, so its not the correct information, I am sorry If I wrong to understand 1 k, isn't it? – Noor Hossain Aug 04 '19 at 17:06
  • 1k!=1000 clicks but it is = 1000 ad requests. Clicks and ad requests are different. – Gourav Aug 05 '19 at 08:21
  • If you understand what I mean then you can click the checkmark right beside my answer. – Gourav Aug 07 '19 at 11:37
0

TO Make sure

  • That you have used your "app id" which app you have publish on store.
  • Second have used your "ad id" which app you have publish on store
  • Third the most important that you have to download and install your app from play store and then check it that it works or not.

    Note: for new ad or app you have to wait for 1 - 2 hours.....thats it...