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

后端 未结 4 2049
遇见更好的自我
遇见更好的自我 2020-12-21 10:35

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 err

4条回答
  •  清酒与你
    2020-12-21 11:13

    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;
        }
    }
    

提交回复
热议问题