当前位置: 首页>>代码示例>>Java>>正文


Java CBError.CBImpressionError方法代码示例

本文整理汇总了Java中com.chartboost.sdk.Model.CBError.CBImpressionError方法的典型用法代码示例。如果您正苦于以下问题:Java CBError.CBImpressionError方法的具体用法?Java CBError.CBImpressionError怎么用?Java CBError.CBImpressionError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.chartboost.sdk.Model.CBError的用法示例。


在下文中一共展示了CBError.CBImpressionError方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: didFailToLoadInterstitial

import com.chartboost.sdk.Model.CBError; //导入方法依赖的package包/类
@Override
public void didFailToLoadInterstitial(String location,
                                      CBError.CBImpressionError error) {
    super.didFailToLoadInterstitial(location, error);
    if (mMediationInterstitialListener != null
            && location.equals(mChartboostParams.getLocation())) {
        if (mIsLoading) {
            mMediationInterstitialListener.onAdFailedToLoad(ChartboostAdapter.this,
                    getAdRequestErrorType(error));
            mIsLoading = false;
        } else if (error
                == CBError.CBImpressionError.INTERNET_UNAVAILABLE_AT_SHOW) {
            // Chartboost sends the CBErrorInternetUnavailableAtShow error when
            // the Chartboost SDK fails to show an ad because no network connection
            // is available.
            mMediationInterstitialListener.onAdOpened(ChartboostAdapter.this);
            mMediationInterstitialListener.onAdClosed(ChartboostAdapter.this);
        }
    }
}
 
开发者ID:googleads,项目名称:googleads-mobile-android-mediation,代码行数:21,代码来源:ChartboostAdapter.java

示例2: didFailToLoadRewardedVideo

import com.chartboost.sdk.Model.CBError; //导入方法依赖的package包/类
@Override
public void didFailToLoadRewardedVideo(String location,
                                       CBError.CBImpressionError error) {
    super.didFailToLoadRewardedVideo(location, error);
    if (mMediationRewardedVideoAdListener != null
            && location.equals(mChartboostParams.getLocation())) {
        if (mIsLoading) {
            mMediationRewardedVideoAdListener.onAdFailedToLoad(
                    ChartboostAdapter.this, getAdRequestErrorType(error));
            mIsLoading = false;
        } else if (error
                == CBError.CBImpressionError.INTERNET_UNAVAILABLE_AT_SHOW) {
            // Chartboost sends the CBErrorInternetUnavailableAtShow error when
            // the Chartboost SDK fails to show an ad because no network connection
            // is available.
            mMediationRewardedVideoAdListener.onAdOpened(ChartboostAdapter.this);
            mMediationRewardedVideoAdListener.onAdClosed(ChartboostAdapter.this);
        }
    }
}
 
开发者ID:googleads,项目名称:googleads-mobile-android-mediation,代码行数:21,代码来源:ChartboostAdapter.java

示例3: didFailToLoadInterstitial

import com.chartboost.sdk.Model.CBError; //导入方法依赖的package包/类
@Override
public void didFailToLoadInterstitial(String location, CBError.CBImpressionError error) {
    super.didFailToLoadInterstitial(location, error);
    ResultCode code = ResultCode.INTERNAL_ERROR;
    switch (error) {
        case INTERNET_UNAVAILABLE:
        case TOO_MANY_CONNECTIONS:
        case NETWORK_FAILURE:
            code = ResultCode.NETWORK_ERROR;
            break;
        case NO_AD_FOUND:
        case VIDEO_UNAVAILABLE:
            code = ResultCode.UNABLE_TO_FILL;
            break;
        case INVALID_LOCATION:
            code = ResultCode.INVALID_REQUEST;
            break;
        case INTERNAL:
        case FIRST_SESSION_INTERSTITIALS_DISABLED:
        case WRONG_ORIENTATION:
        case SESSION_NOT_STARTED:
        case IMPRESSION_ALREADY_VISIBLE:
        case NO_HOST_ACTIVITY:
        case USER_CANCELLATION:
        case VIDEO_ID_MISSING:
        case ERROR_PLAYING_VIDEO:
        case INVALID_RESPONSE:
        case ASSETS_DOWNLOAD_FAILURE:
        case ERROR_CREATING_VIEW:
        case ERROR_DISPLAYING_VIEW:
        case INCOMPATIBLE_API_VERSION:
            code = ResultCode.INTERNAL_ERROR;
            break;
    }
    ChartboostListener l = listenerMap.get(location);
    if (l != null) {
        l.didFailToLoadInterstitial(location, code);
    }
}
 
开发者ID:appnexus,项目名称:mobile-sdk-android,代码行数:40,代码来源:ChartboostDelegateBridge.java

示例4: getAdRequestErrorType

import com.chartboost.sdk.Model.CBError; //导入方法依赖的package包/类
/**
 * This method will return an error type that can be read by Google Mobile Ads SDK.
 *
 * @param error CBImpressionError type to be translated to Google Mobile Ads SDK readable
 *              error code.
 * @return Ad request error code.
 */
private static int getAdRequestErrorType(CBError.CBImpressionError error) {
    switch (error) {
        case INTERNAL:
        case INVALID_RESPONSE:
        case NO_HOST_ACTIVITY:
        case USER_CANCELLATION:
        case WRONG_ORIENTATION:
        case ERROR_PLAYING_VIDEO:
        case ERROR_CREATING_VIEW:
        case SESSION_NOT_STARTED:
        case ERROR_DISPLAYING_VIEW:
        case ERROR_LOADING_WEB_VIEW:
        case INCOMPATIBLE_API_VERSION:
        case ASSET_PREFETCH_IN_PROGRESS:
        case IMPRESSION_ALREADY_VISIBLE:
        case ACTIVITY_MISSING_IN_MANIFEST:
        case WEB_VIEW_CLIENT_RECEIVED_ERROR:
            return AdRequest.ERROR_CODE_INTERNAL_ERROR;
        case NETWORK_FAILURE:
        case END_POINT_DISABLED:
        case INTERNET_UNAVAILABLE:
        case TOO_MANY_CONNECTIONS:
        case ASSETS_DOWNLOAD_FAILURE:
        case WEB_VIEW_PAGE_LOAD_TIMEOUT:
            return AdRequest.ERROR_CODE_NETWORK_ERROR;
        case INVALID_LOCATION:
        case VIDEO_ID_MISSING:
        case HARDWARE_ACCELERATION_DISABLED:
        case FIRST_SESSION_INTERSTITIALS_DISABLED:
            return AdRequest.ERROR_CODE_INVALID_REQUEST;
        case INTERNET_UNAVAILABLE_AT_SHOW:
        case NO_AD_FOUND:
        case ASSET_MISSING:
        case VIDEO_UNAVAILABLE:
        case EMPTY_LOCAL_VIDEO_LIST:
        case PENDING_IMPRESSION_ERROR:
        case VIDEO_UNAVAILABLE_FOR_CURRENT_ORIENTATION:
        default:
            return AdRequest.ERROR_CODE_NO_FILL;
    }
}
 
开发者ID:googleads,项目名称:googleads-mobile-android-mediation,代码行数:49,代码来源:ChartboostAdapter.java


注:本文中的com.chartboost.sdk.Model.CBError.CBImpressionError方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。