我希望使用chartboost,vungle和adcolony与admob mediation。
我已通过vungle和adcolony成功制作了广告。但没有使用chardboost制作广告。
vunglePub.init(getActivity(), "String");
AdColony.configure(getActivity(), "version", "String", "String");
MobileAds.initialize(getActivity(), "String");
mAd = MobileAds.getRewardedVideoAdInstance(getActivity());
FromRewardVideos();
Bundle bundle = new Bundle();
adRequest = new AdRequest.Builder()
.addNetworkExtrasBundle(VungleInterstitialAdapter.class, bundle)
.addNetworkExtrasBundle(AdColonyAdapter.class, bundle)
.addTestDevice("device_id")
.build();
我正在尝试像这样实现ChartBoost -
Chartboost.startWithAppId(getActivity(),"id","signature");
DelegateMethod();
Chartboost.setDelegate(chartboostDelegate);
Chartboost.onCreate(getActivity());
private void AdLoad() {
if (Chartboost.hasRewardedVideo(CBLocation.LOCATION_DEFAULT)) {
Chartboost.showRewardedVideo(CBLocation.LOCATION_DEFAULT);
}
else {
// We don't have a cached video right now, but try to get one for next time
Chartboost.cacheRewardedVideo(CBLocation.LOCATION_DEFAULT);
}
}
private void DelegateMethod() {
chartboostDelegate = new ChartboostDelegate() {
@Override
public void didFailToLoadRewardedVideo(String location, CBError.CBImpressionError error) {
super.didFailToLoadRewardedVideo(location, error);
Chartboost.cacheRewardedVideo(CBLocation.LOCATION_DEFAULT);
}
};
}
并像这样调用adbuilder
Bundle bundle = new Bundle();
adRequest = new AdRequest.Builder()
.addNetworkExtrasBundle(ChartboostAdapter.class, bundle)
.addTestDevice("device_id")
.build();
提前致谢
答案 0 :(得分:2)
如果您尝试通过AdColony调解所有这些网络,我相信您不应该自己初始化所有广告网络。 AdMob适配器的功能是在您调用广告时初始化每个广告网络。
我知道特别是对于Chartboost,如果你在Chartboost适配器之外初始化SDK,AdMob与Chartboost的集成将会失败,你最好自己使用Chartboost。 AdMob打算让适配器完成所有初始化。
我相信他们在此链接上有关于如何整合每个广告网络的官方说明:https://firebase.google.com/docs/admob/ios/mediation-networks