我希望将 chartboost、vungle 和 adcolony 与 admob 中介一起使用。
我已经通过 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();
提前致谢