本文整理汇总了Java中com.facebook.ads.InterstitialAd类的典型用法代码示例。如果您正苦于以下问题:Java InterstitialAd类的具体用法?Java InterstitialAd怎么用?Java InterstitialAd使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InterstitialAd类属于com.facebook.ads包,在下文中一共展示了InterstitialAd类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: request
import com.facebook.ads.InterstitialAd; //导入依赖的package包/类
@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();
}
}
}
开发者ID:pubnative,项目名称:pubnative-android-sdk,代码行数:18,代码来源:FacebookNetworkInterstitialAdapter.java
示例2: requestInterstitialAd
import com.facebook.ads.InterstitialAd; //导入依赖的package包/类
@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();
}
开发者ID:googleads,项目名称:googleads-mobile-android-mediation,代码行数:20,代码来源:FacebookAdapter.java
示例3: showAd
import com.facebook.ads.InterstitialAd; //导入依赖的package包/类
@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();
}
开发者ID:callstack,项目名称:react-native-fbads,代码行数:14,代码来源:InterstitialAdManager.java
示例4: requestAd
import com.facebook.ads.InterstitialAd; //导入依赖的package包/类
@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();
}
开发者ID:appnexus,项目名称:mobile-sdk-android,代码行数:8,代码来源:FacebookInterstitial.java
注:本文中的com.facebook.ads.InterstitialAd类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论