我已经放置了mopub和adcolony sdk,我使用adcolony zone id,app id等在mopub web中建立了网络。 mopub测试广告正在播放,但我无法调解adcolony广告.. 注意 - 我已经为新的5.0。+ mopub sdk初始化了Sdkconfiguration。 但是我对调解设置很困惑。 任何人帮助我...
广告活动中的代码: //要初始化的激励视频适配器列表 List networksToInit = new ArrayList(); networksToInit.add(" com.mopub.mobileads.AdColonyRewardedVideo&#34);
final AdColonyRewardedVideo.AdColonyGlobalMediationSettings globalMediationSettings =
MoPubRewardedVideoManager.getGlobalMediationSettings(AdColonyRewardedVideo.AdColonyGlobalMediationSettings.class);
SdkConfiguration sdkConfiguration = new SdkConfiguration.Builder(getResources().getString(R.string.mopub_ad_unit_rewarded_video))
.withMediationSettings(globalMediationSettings)
.withNetworksToInit(networksToInit)
.build();
SdkInitializationListener initSdkListener=new SdkInitializationListener() {
@Override
public void onInitializationFinished() {
final PersonalInfoManager mPersonalInfoManager = MoPub.getPersonalInformationManager();
ConsentDialogListener consentDialogListener=new ConsentDialogListener() {
@Override
public void onConsentDialogLoaded() {
if (mPersonalInfoManager != null) {
mPersonalInfoManager.showConsentDialog();
}
}
@Override
public void onConsentDialogLoadFailed(@NonNull MoPubErrorCode moPubErrorCode) {
MoPubLog.i("Consent dialog failed to load.");
}
};
if (mPersonalInfoManager != null && mPersonalInfoManager.shouldShowConsentDialog()) {
mPersonalInfoManager.loadConsentDialog(consentDialogListener);
}
}
};
if (!MoPub.isSdkInitialized()) {
MoPub.initializeSdk(PurchaseActivity.this, sdkConfiguration, initSdkListener);
}
MoPub.onCreate(PurchaseActivity.this);
// MoPub奖励视频听众
@Override public void onRewardedVideoLoadSuccess(@NonNull String adUnitId) {
progressBar.setVisibility(View.GONE);
MoPubRewardedVideos.showRewardedVideo(getResources().getString(
R.string.ad_unit_id_rewarded_video));}
@Override
public void onRewardedVideoLoadFailure(@NonNull String adUnitId, @NonNull MoPubErrorCode errorCode) {
progressBar.setVisibility(View.GONE);
Toast.makeText(PurchaseActivity.this, "Failed to load Ads", Toast.LENGTH_SHORT).show();
}
//和其他方法