Admob自定义事件Intererstitial不起作用

时间:2015-04-08 02:50:32

标签: android ios admob chartboost

我一直在尝试为Chartboost插页式广告实施admob自定义事件,但自定义事件永远不会触发。

我在admob上添加自定义事件设置页面我将我的类名设置为 com.mycompany.advertising.ChartBoostInterstitial

该文件位于此包中,src文件夹/ com.mycompany.advertising.ChartBoostInterstitial

这是班级,

import android.content.Context;
import android.os.Bundle;

import com.chartboost.sdk.CBLocation;
import com.chartboost.sdk.Chartboost;
import com.google.android.gms.ads.mediation.MediationAdRequest;
import com.google.android.gms.ads.mediation.customevent.CustomEventInterstitial;
import com.google.android.gms.ads.mediation.customevent.CustomEventInterstitialListener;

public class ChartBoostInterstitial implements CustomEventInterstitial {


    public static CustomEventInterstitialListener mListener;

    @Override
    public void requestInterstitialAd(Context context,
            CustomEventInterstitialListener listener, String serverParameter,
            MediationAdRequest mediationAdRequest, Bundle customEventExtras) {
        System.out.println("GOOGLE MEDIATION CALLING THIS!!!!!!!!!!!!!!!!!!!!!!!!!!!");

            mListener = listener;
            Chartboost.cacheInterstitial(CBLocation.LOCATION_DEFAULT);

    }

    @Override
    public void showInterstitial() {
        Chartboost.showInterstitial(CBLocation.LOCATION_DEFAULT);
    }

    @Override
    public void onDestroy() {
        // TODO Auto-generated method stub

    }

    @Override
    public void onPause() {
        // TODO Auto-generated method stub

    }

    @Override
    public void onResume() {
        // TODO Auto-generated method stub

    }

手册不清楚这个类是否应该被实例化。 System.out.println(" GOOGLE MEDIATION CALLING THIS !!!!!!!!!!!!!!!!!!!!!!!!!!!");无论我加载多少广告,都不会被调用。如果我至少可以打印这一行,那么我应该能够构建自定义事件适配器的其余部分。唯一发生的事情是正常的adMob插页加载。

1 个答案:

答案 0 :(得分:0)

指定类的正确路径 com中的com.packagename.classname在admob中新创建的自定义

在观察中,你不能期待这些变化能够立即发生......需要花费一个多小时才能得到反映。

快乐编码