Admob电容器无法在Android中展示测试广告 [英] Admob-capacitor unable to show test ads in Android
问题描述
我已在离子应用程序中安装了admob电容器.我已遵循其指南中的所有步骤( https://admob-capacitor.com/capacitor-setup ).
I have installed admob-capacitor in my ionic app. I have followed all the steps from its guide (https://admob-capacitor.com/capacitor-setup).
我正尝试按以下方式展示测试广告:
I am trying to show test ads as follows:
const options = {
isTesting: true,
bannerAdId: 'ca-app-pub-9696899809581135/1268150728',
};
当我使用AdMob Android官方测试标语(ca-app-pub-3940256099942544/6300978111
)时,效果很好.但是当我要测试自己的ID时,它仅在设备底部显示一个黑色矩形.
It works well when I use the AdMob Android official test banner (ca-app-pub-3940256099942544/6300978111
). But when I want to test my own id, it only shows a black rectangle in the bottom of the device.
在Android上启动电容器应用程序时,Android Studio Logcat中会出现错误:
When starting my capacitor application on Android, an error appears in the Android Studio Logcat:
I/Ads: Ad failed to load : 3
我已经搜索了此错误,很多答案依赖于等待Google允许我的应用程序,但是我已经等了两个多星期了... 我想念什么吗?
I have searched for this error and a lots of answers rely on waiting for Google to allow my application but I have been waiting for more than two weeks now... Am I missing something?
推荐答案
这也发生在我身上,我通过替换应用ID来解决:
That happened to me too and I solved by replacing the app id:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.your.awesome.app.id"> <!-- replace your app id -->
这篇关于Admob电容器无法在Android中展示测试广告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!