Java 类com.facebook.ads.AdError 实例源码

项目:mopub-nativead-adapters    文件:FacebookNativeAd.java   
@Override
public void onError(final Ad ad, final AdError adError) {
    if (adError == null) {
        this.getCustomEventNativeListener().onNativeAdFailed(NativeErrorCode.UNSPECIFIED);
    } else {
        switch (adError.getErrorCode()) {
            case AdError.NO_FILL_ERROR_CODE:
                this.getCustomEventNativeListener().onNativeAdFailed(NativeErrorCode.NETWORK_NO_FILL);
                break;

            case AdError.NETWORK_ERROR_CODE:
                this.getCustomEventNativeListener().onNativeAdFailed(NativeErrorCode.CONNECTION_ERROR);
                break;

            case AdError.SERVER_ERROR_CODE:
                this.getCustomEventNativeListener().onNativeAdFailed(NativeErrorCode.SERVER_ERROR_RESPONSE_CODE);
                break;

            default:
                this.getCustomEventNativeListener().onNativeAdFailed(NativeErrorCode.UNEXPECTED_RESPONSE_CODE);
                break;
        }
    }
}
项目:pubnative-android-sdk    文件:FacebookNetworkAdapter.java   
@Override
public void onError(Ad ad, AdError adError) {

    String errorString = DEFAULT_ERROR;
    if (adError != null) {
        errorString = adError.getErrorCode() + " - " + adError.getErrorMessage();
    }
    if (adError == null) {
        invokeLoadFail(new Exception(errorString));
    } else {

        switch (adError.getErrorCode()) {
            case AdError.NO_FILL_ERROR_CODE:
            case AdError.LOAD_TOO_FREQUENTLY_ERROR_CODE:
            case Facebook.ERROR_NO_FILL_1203:
                invokeLoadFail(new Exception("Facebook error: no-fill"));
                break;
            default:
                invokeLoadFail(new Exception(errorString));
                break;
        }
    }
}
项目:pubnative-android-sdk    文件:FacebookNetworkAdapter.java   
@Override
public void onError(Ad ad, AdError adError) {

    String errorString = DEFAULT_ERROR;
    if (adError != null) {
        errorString = adError.getErrorCode() + " - " + adError.getErrorMessage();
    }
    if (adError == null) {
        invokeLoadFail(new Exception(errorString));
    } else {

        switch (adError.getErrorCode()) {
            case AdError.NO_FILL_ERROR_CODE:
            case AdError.LOAD_TOO_FREQUENTLY_ERROR_CODE:
            case Facebook.ERROR_NO_FILL_1203:
                invokeLoadFinish(null);
                break;
            default:
                invokeLoadFail(new Exception(errorString));
                break;
        }
    }
}
项目:adsnative-sdk-android    文件:FacebookAdNetwork.java   
@Override
public void onError(final Ad ad, final AdError adError) {
    ANLog.e("FacebookAdNetwork#onError");
    if (adError == null) {
        ANLog.e("FacebookAdNetwork: " + ErrorCode.UNSPECIFIED);
        mCustomEventListener.onNativeAdFailed(ErrorCode.UNSPECIFIED);
    } else if (adError.getErrorCode() == AdError.NO_FILL.getErrorCode()) {
        ANLog.e("FacebookAdNetwork: " + ErrorCode.NETWORK_NO_FILL);
        mCustomEventListener.onNativeAdFailed(ErrorCode.NETWORK_NO_FILL);
    } else if (adError.getErrorCode() == AdError.INTERNAL_ERROR.getErrorCode()) {
        ANLog.e("FacebookAdNetwork: " + ErrorCode.NETWORK_INVALID_STATE + " : " +
                AdError.INTERNAL_ERROR.getErrorCode());
        mCustomEventListener.onNativeAdFailed(ErrorCode.NETWORK_INVALID_STATE);
    } else {
        ANLog.e("FacebookAdNetwork: " + adError.getErrorMessage());
        mCustomEventListener.onNativeAdFailed(ErrorCode.UNSPECIFIED);
    }
}
项目:adsnative-sdk-android    文件:FacebookAdNetwork.java   
@Override
public void onError(final Ad ad, final AdError adError) {
    ANLog.e("FacebookAdNetwork#onError");
    if (adError == null) {
        ANLog.e("FacebookAdNetwork: " + ErrorCode.UNSPECIFIED);
        mCustomEventListener.onNativeAdFailed(ErrorCode.UNSPECIFIED);
    } else if (adError.getErrorCode() == AdError.NO_FILL.getErrorCode()) {
        ANLog.e("FacebookAdNetwork: " + ErrorCode.NETWORK_NO_FILL);
        mCustomEventListener.onNativeAdFailed(ErrorCode.NETWORK_NO_FILL);
    } else if (adError.getErrorCode() == AdError.INTERNAL_ERROR.getErrorCode()) {
        ANLog.e("FacebookAdNetwork: " + ErrorCode.NETWORK_INVALID_STATE + " : " +
                AdError.INTERNAL_ERROR.getErrorCode());
        mCustomEventListener.onNativeAdFailed(ErrorCode.NETWORK_INVALID_STATE);
    } else {
        ANLog.e("FacebookAdNetwork: " + adError.getErrorMessage());
        mCustomEventListener.onNativeAdFailed(ErrorCode.UNSPECIFIED);
    }
}
项目:googleads-mobile-android-mediation    文件:FacebookAdapter.java   
/**
 * Converts an {@link AdError} code to Google Mobile Ads SDK readable error code.
 *
 * @param adError the {@link AdError} to be converted.
 * @return an {@link AdRequest} error code.
 */
private int convertErrorCode(AdError adError) {
    if (adError == null) {
        return AdRequest.ERROR_CODE_INTERNAL_ERROR;
    }
    int errorCode = adError.getErrorCode();
    switch (errorCode) {
        case AdError.NETWORK_ERROR_CODE:
        case AdError.SERVER_ERROR_CODE:
            return AdRequest.ERROR_CODE_NETWORK_ERROR;
        case AdError.NO_FILL_ERROR_CODE:
            return AdRequest.ERROR_CODE_NO_FILL;
        case AdError.LOAD_TOO_FREQUENTLY_ERROR_CODE:
            return AdRequest.ERROR_CODE_INVALID_REQUEST;
        case AdError.INTERNAL_ERROR_CODE:
        default:
            return AdRequest.ERROR_CODE_INTERNAL_ERROR;
    }
}
项目:mobile-sdk-android    文件:FacebookListener.java   
@Override
public void onError(Ad ad, AdError adError) {
    Clog.d(Clog.mediationLogTag, className + " | Facebook - onError called for AdView with error message " + adError.getErrorMessage());
    ResultCode code;

    if (adError.getErrorCode() == AdError.NO_FILL.getErrorCode()) {
        code = ResultCode.UNABLE_TO_FILL;
    } else if (adError.getErrorCode() == AdError.LOAD_TOO_FREQUENTLY.getErrorCode()) {
        code = ResultCode.INVALID_REQUEST;
    } else if (adError.getErrorCode() == AdError.INTERNAL_ERROR.getErrorCode()) {
        code = ResultCode.INTERNAL_ERROR;
    } else if (adError.getErrorCode() == AdError.MISSING_PROPERTIES.getErrorCode()) {
        code = ResultCode.INVALID_REQUEST;
    } else {
        code = ResultCode.INTERNAL_ERROR;
    }

    if (mediatedAdViewController != null) {
        mediatedAdViewController.onAdFailed(code);
    }
}
项目:pubnative-android-sdk    文件:FacebookNetworkInterstitialAdapter.java   
@Override
public void onError(Ad ad, AdError adError) {
    String errorString = DEFAULT_ERROR;
    if (adError != null) {
        errorString = adError.getErrorCode() + " - " + adError.getErrorMessage();
    }
    invokeLoadFail(new Exception(errorString));
}
项目:pubnative-android-sdk    文件:FacebookNetworkAdapter.java   
@Override
public void onError(Ad ad, AdError adError) {
    String errorString = DEFAULT_ERROR;
    if (adError != null) {
        errorString = adError.getErrorCode() + " - " + adError.getErrorMessage();
    }
    invokeLoadFail(new Exception(errorString));
}
项目:pubnative-android-sdk    文件:FacebookNetworkAdapter.java   
@Override
public void onError(Ad ad, AdError adError) {
    String errorString = DEFAULT_ERROR;
    if (adError != null) {
        errorString = adError.getErrorCode() + " - " + adError.getErrorMessage();
    }
    invokeLoadFail(new Exception(errorString));
}
项目:react-native-fbads    文件:BannerView.java   
@Override
public void onError(Ad ad, AdError adError) {
  WritableMap event = Arguments.createMap();

  event.putInt("errorCode", adError.getErrorCode());
  event.putString("errorMessage", adError.getErrorMessage());
  mEventEmitter.receiveEvent(getId(), "onAdError", event);

  myAdView = null;
}
项目:googleads-mobile-android-mediation    文件:FacebookAdapter.java   
@Override
public void onError(Ad ad, AdError adError) {
    String errorMessage = adError.getErrorMessage();
    if (!TextUtils.isEmpty(errorMessage)) {
        Log.w(TAG, errorMessage);
    }
    FacebookAdapter.this.mBannerListener.onAdFailedToLoad(
            FacebookAdapter.this, convertErrorCode(adError));
}
项目:googleads-mobile-android-mediation    文件:FacebookAdapter.java   
@Override
public void onError(Ad ad, AdError adError) {
    String errorMessage = adError.getErrorMessage();
    if (!TextUtils.isEmpty(errorMessage)) {
        Log.w(TAG, errorMessage);
    }
    FacebookAdapter.this.mInterstitialListener.onAdFailedToLoad(
            FacebookAdapter.this, convertErrorCode(adError));
}
项目:googleads-mobile-android-mediation    文件:FacebookAdapter.java   
@Override
public void onError(Ad ad, AdError adError) {
    String errorMessage = adError.getErrorMessage();
    if (!TextUtils.isEmpty(errorMessage)) {
        Log.w(TAG, errorMessage);
    }

    mRewardedListener.onAdFailedToLoad(FacebookAdapter.this, convertErrorCode(adError));
}
项目:googleads-mobile-android-mediation    文件:FacebookAdapter.java   
@Override
public void onError(Ad ad, AdError adError) {
    String errorMessage = adError.getErrorMessage();
    if (!TextUtils.isEmpty(errorMessage)) {
        Log.w(TAG, errorMessage);
    }
    FacebookAdapter.this.mNativeListener.onAdFailedToLoad(
            FacebookAdapter.this, convertErrorCode(adError));
}
项目:kognitivo    文件:RectangleFragment.java   
@Override
public void onError(Ad ad, AdError error) {
    if (ad == adViewRectangle) {
        setLabel("Ad failed to load: " + error.getErrorMessage());
    }
}
项目:kognitivo    文件:BannerFragment.java   
@Override
public void onError(Ad ad, AdError error) {
    if (ad == adViewBanner) {
        setLabel("Ad failed to load: " + error.getErrorMessage());
    }
}
项目:kognitivo    文件:InterstitialFragment.java   
@Override
public void onError(Ad ad, AdError error) {
    if (ad == interstitialAd) {
        setLabel("Interstitial ad failed to load: " + error.getErrorMessage());
    }
}
项目:sekai    文件:NativeAdSampleActivity.java   
@Override
public void onError(Ad ad, AdError error) {
    nativeAdStatus.setText("Ad failed to load: " + error.getErrorMessage());
}
项目:sekai    文件:NativeAdHscrollActivity.java   
@Override
public void onAdError(AdError error) {
    Toast.makeText(this, "Ad error: " + error.getErrorMessage(), Toast.LENGTH_SHORT).show();
}
项目:sekai    文件:RectangleFragment.java   
@Override
public void onError(Ad ad, AdError error) {
    if (ad == rectangleAdView) {
        setLabel("Ad failed to load: " + error.getErrorMessage());
    }
}
项目:sekai    文件:BannerFragment.java   
@Override
public void onError(Ad ad, AdError error) {
    if (ad == bannerAdView) {
        setLabel("Ad failed to load: " + error.getErrorMessage());
    }
}
项目:sekai    文件:InstreamVideoFragment.java   
@Override
public void onError(Ad ad, AdError error) {
  if (ad == instreamVideoAdView) {
    setStatusLabelText("Instream video ad failed to load: " + error.getErrorMessage());
  }
}
项目:sekai    文件:RewardedVideoFragment.java   
@Override
public void onError(Ad ad, AdError error) {
    if (ad == rewardedVideoAd) {
        setStatusLabelText("Rewarded video ad failed to load: " + error.getErrorMessage());
    }
}
项目:sekai    文件:InterstitialFragment.java   
@Override
public void onError(Ad ad, AdError error) {
    if (ad == interstitialAd) {
        setLabel("Interstitial ad failed to load: " + error.getErrorMessage());
    }
}
项目:aptoide-client    文件:FragmentSocialTimeline.java   
@Override
public void onError(Ad ad, AdError error) {
    Logger.d("FragmentSocialTimeline"," onError "+error.getErrorMessage());
    Logger.d("FragmentSocialTimeline"," onError code:"+error.getErrorCode());
}
项目:pubnative-android-sdk    文件:FacebookNativeAdModel.java   
@Override
public void onError(Ad ad, AdError adError) {
}
项目:react-native-fbads    文件:NativeAdManager.java   
@Override
public void onAdError(AdError adError) {
    // @todo handle errors here
}
项目:react-native-fbads    文件:InterstitialAdManager.java   
@Override
public void onError(Ad ad, AdError adError) {
  mPromise.reject("E_FAILED_TO_LOAD", adError.getErrorMessage());
  cleanUp();
}
项目:Sportmix    文件:FotomacFragment.java   
@Override
public void onError(Ad ad, AdError adError) {

    Toast.makeText(getActivity(), "Ad failed to load: " +  adError.getErrorMessage(), Toast.LENGTH_SHORT).show();
}
项目:Sportmix    文件:FotomacFragment.java   
@Override
public void onAdError(AdError adError) {
    Toast.makeText(getActivity(), "Native ads manager failed to load: " +  adError.getErrorMessage(),
            Toast.LENGTH_SHORT).show();
}
项目:Sportmix    文件:TrtsporFragment.java   
@Override
public void onError(Ad ad, AdError adError) {

    Toast.makeText(getActivity(), "Ad failed to load: " +  adError.getErrorMessage(), Toast.LENGTH_SHORT).show();
}
项目:Sportmix    文件:TrtsporFragment.java   
@Override
public void onAdError(AdError adError) {
    Toast.makeText(getActivity(), "Native ads manager failed to load: " +  adError.getErrorMessage(),
            Toast.LENGTH_SHORT).show();
}
项目:Sportmix    文件:SporxFragment.java   
@Override
public void onError(Ad ad, AdError adError) {

    Toast.makeText(getActivity(), "Ad failed to load: " +  adError.getErrorMessage(), Toast.LENGTH_SHORT).show();
}
项目:Sportmix    文件:SporxFragment.java   
@Override
public void onAdError(AdError adError) {
    Toast.makeText(getActivity(), "Native ads manager failed to load: " +  adError.getErrorMessage(),
            Toast.LENGTH_SHORT).show();
}
项目:Sportmix    文件:SabahFragment.java   
@Override
public void onError(Ad ad, AdError adError) {

    Toast.makeText(getActivity(), "Ad failed to load: " +  adError.getErrorMessage(), Toast.LENGTH_SHORT).show();
}
项目:Sportmix    文件:SabahFragment.java   
@Override
public void onAdError(AdError adError) {
    Toast.makeText(getActivity(), "Native ads manager failed to load: " +  adError.getErrorMessage(),
            Toast.LENGTH_SHORT).show();
}
项目:Sportmix    文件:EuroSportFragment.java   
@Override
public void onError(Ad ad, AdError adError) {

    Toast.makeText(getActivity(), "Ad failed to load: " +  adError.getErrorMessage(), Toast.LENGTH_SHORT).show();
}
项目:Sportmix    文件:EuroSportFragment.java   
@Override
public void onAdError(AdError adError) {
    Toast.makeText(getActivity(), "Native ads manager failed to load: " +  adError.getErrorMessage(),
            Toast.LENGTH_SHORT).show();
}
项目:Sportmix    文件:LigTvFragment.java   
@Override
public void onError(Ad ad, AdError adError) {

    Toast.makeText(getActivity(), "Ad failed to load: " +  adError.getErrorMessage(), Toast.LENGTH_SHORT).show();
}