Tôi đang triển khai mã cho quảng cáo gốc do google cung cấp. Đó là làm việc ổn với google
Không tải được Quảng cáo gốc: 0 Lỗi
quảng cáo đơn vị id ADMOB_AD_UNIT_ID = "ca-app-pub-3940256099942544/2247696110"
Nhưng khi tôi thay bằng id của tôi quảng cáo không hiển thị của nó và thực hiện onAdFailedToLoad
phương pháp và có Không thể tải quảng cáo gốc: 0 lỗi.
I tried two different ad unit id but it didn't load ad.
so what should I do??please help me
tôi đã cố gắng mã dưới đây
final LayoutInflater li = (LayoutInflater) appContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
AdLoader.Builder builder = new AdLoader.Builder(appContext, Global.ADMOB_AD_UNIT_ID);
builder.forContentAd(new NativeContentAd.OnContentAdLoadedListener() {
@Override
public void onContentAdLoaded(NativeContentAd ad) {
//viewHolder.rlnativead.setVisibility(View.VISIBLE);
NativeContentAdView adView = (NativeContentAdView)li
.inflate(R.layout.ad_content, null);
populateContentAdView(ad, adView);
viewHolder.fl_adplaceholder.removeAllViews();
viewHolder.fl_adplaceholder.addView(adView);
}
});
AdLoader adLoader = builder.withAdListener(new AdListener() {
@Override
public void onAdFailedToLoad(int errorCode) {
// Toast.makeText(appContext, "Failed to load native ad: "
// + errorCode, Toast.LENGTH_SHORT).show();
Log.e("Call List adapter","Failed to load native ad: "+errorCode);
}
}).build();
adLoader.loadAd(new AdRequest.Builder().build());
tôi đã nhận giải pháp friends..this ADMOB_AD_UNIT_ID là dành cho expressview mẹ đẻ vì vậy nó sẽ chỉ sử dụng bởi expressview bản địa Chúng tôi không thể sử dụng cho trước xem bản địa hiện quảng cáo tự nhiên là ở dưới beta – sunita