Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

android - Rewarded video ads-Failed to load ad error code 3 admob

I stuck for 3 days on implementing AdMob Rewarded Video , the code is completely find but when I launch the app it's said "onRewardedVideoAdFailedToLoad" and getting error code 3 and ad won't display kindly please help me what i do?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Error code is 3 stand for the ad request was successful, but no ad was returned due to lack of ad inventory.

The document is here https://developers.google.com/android/reference/com/google/android/gms/ads/AdRequest#ERROR_CODE_NO_FILL

You can implement this small function to get the knowledge of error code.

   private int getAdMobErrorCode(SampleErrorCode errorCode) {
    switch (errorCode) {
        case BAD_REQUEST:
        return AdRequest.ERROR_CODE_INVALID_REQUEST;
    case NETWORK_ERROR:
        return AdRequest.ERROR_CODE_NETWORK_ERROR;
    case NO_INVENTORY:
        return AdRequest.ERROR_CODE_NO_FILL;
    case UNKNOWN:
    default:
        return AdRequest.ERROR_CODE_INTERNAL_ERROR;
    }
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...