本文整理汇总了Java中com.chartboost.sdk.Model.CBError类的典型用法代码示例。如果您正苦于以下问题:Java CBError类的具体用法?Java CBError怎么用?Java CBError使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CBError类属于com.chartboost.sdk.Model包,在下文中一共展示了CBError类的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);
}
}
}
示例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);
}
}
}
示例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);
}
}
示例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;
}
}