Java 类com.facebook.ads.InterstitialAd 实例源码

项目:pubnative-android-sdk    文件:FacebookNetworkInterstitialAdapter.java   
@Override
protected void request(Context context, Map<String, String> networkData) {
    if (context == null || networkData == null) {
        invokeLoadFail(PNException.ADAPTER_MISSING_DATA);
    } else {
        mContext = context;
        String placementId = networkData.get(Facebook.KEY_PLACEMENT_ID);
        if (TextUtils.isEmpty(placementId)) {
            invokeLoadFail(PNException.ADAPTER_ILLEGAL_ARGUMENTS);
        } else {
            Facebook.init(context);
            mInterstitialAd = new InterstitialAd(mContext, placementId);
            mInterstitialAd.setAdListener(this);
            mInterstitialAd.loadAd();
        }
    }
}
项目:googleads-mobile-android-mediation    文件:FacebookAdapter.java   
@Override
public void requestInterstitialAd(Context context,
                                  MediationInterstitialListener listener,
                                  Bundle serverParameters,
                                  MediationAdRequest adRequest,
                                  Bundle mediationExtras) {
    mInterstitialListener = listener;
    if (!isValidRequestParameters(context, serverParameters)) {
        mInterstitialListener.onAdFailedToLoad(this, AdRequest.ERROR_CODE_INVALID_REQUEST);
        return;
    }

    String placementId = serverParameters.getString(PLACEMENT_PARAMETER);

    mInterstitialAd = new InterstitialAd(context, placementId);
    mInterstitialAd.setAdListener(new InterstitialListener());
    buildAdRequest(adRequest);
    mInterstitialAd.loadAd();
}
项目:react-native-fbads    文件:InterstitialAdManager.java   
@ReactMethod
public void showAd(String placementId, Promise p) {
  if (mPromise != null) {
    p.reject("E_FAILED_TO_SHOW", "Only one `showAd` can be called at once");
    return;
  }
  ReactApplicationContext reactContext = this.getReactApplicationContext();

  mPromise = p;
  mInterstitial = new InterstitialAd(reactContext, placementId);
  mInterstitial.setAdListener(this);
  mInterstitial.loadAd();
}
项目:mobile-sdk-android    文件:FacebookInterstitial.java   
@Override
public void requestAd(MediatedInterstitialAdViewController mIC, Activity activity, String parameter, String uid, TargetingParameters tp) {
    FacebookListener fbListener = new FacebookListener(mIC, this.getClass().getSimpleName());
    interstitialAd = new InterstitialAd(activity, uid);
    interstitialAd.setAdListener(fbListener);
    interstitialAd.loadAd();
}