0

I am looking to use chartboost,vungle and adcolony with admob mediation.

I have successfully generated ads through vungle and adcolony.But not getting ads with 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();

And i am trying to implement ChartBoost like this -

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);



        }

    };
}

And calling adbuilder like this

Bundle bundle = new Bundle();


    adRequest = new AdRequest.Builder()
        .addNetworkExtrasBundle(ChartboostAdapter.class, bundle)
        .addTestDevice("device_id")
        .build();

Thanks in advance

Akshay Sahai
  • 2,121
  • 1
  • 17
  • 20

1 Answers1

2

If you're trying to mediate all of these networks through AdColony, I believe you are NOT supposed to be initializing all of the ad networks on their own. The AdMob adapter functions by initializing each ad network as you call for an ad.

I know that for Chartboost in particular, if you initialize the SDK outside of the Chartboost adapter, the AdMob integration with Chartboost will simply fail and you're better off using Chartboost on its own. AdMob intends to have the adapter do all of the initializing.

I believe they have official instructions on how to integrate each ad network at this link here: https://firebase.google.com/docs/admob/ios/mediation-networks

C.amiry
  • 116
  • 2
  • i am not mediating all these networks through adcolony,but through admob. alright , so you are saying that i should not initialize all these adapters separately. Admob will automatically do that, as i have already set my app ids,secrets and other keys in admob console? – Akshay Sahai Jan 20 '17 at 00:04
  • That was a typo, I did mean AdMob. And yes, AdMob should take care of everything when you call an ad. – C.amiry Jan 27 '17 at 18:43