简体   繁体   English

真正的 Admob 插页式广告在测试 Android 应用程序期间未显示

[英]Real Admob Interstitial Ads Not Displaying During Testing of Android App

This is my first app, and it is all complete except for the ads.这是我的第一个应用程序,除了广告之外,它都是完整的。 For clarification:为了澄清:

  • I was able to get the test Interstitial ads to show up correctly, so test ads work perfectly我能够让测试插页式广告正确显示,因此测试广告可以完美运行
  • I just added the payment information to my account a few hours ago几小时前我刚刚将付款信息添加到我的帐户中
  • I have received an email from Admob with my official App ID # and Ad Unit Id #我收到了来自 Admob 的 email 以及我的官方 App ID # 和 Ad Unit Id #
  • I have browsed around the forums and have read it may take a few hours of a few days for real ads to show我浏览了论坛并阅读了真实的广告可能需要几天的几个小时才能显示

My first question is what number should I put in the the Manifest file for real ads?我的第一个问题是我应该在真实广告的 Manifest 文件中输入什么数字? From the documentation for testing:从测试文档中:

Sample AdMob app ID: ca-app-pub-3940256099942544~3347511713<manifest>
    <application>
        <!-- Sample AdMob app ID: ca-app-pub-3940256099942544~3347511713 -->
        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/>
    </application>
</manifest>

To show a real ads, I'm confused about what to input for the value:为了展示真实的广告,我对输入的值感到困惑:

android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy

Example for the the xxxxxs - I have an App ID # and an Ad Unit Id#, but neither are long enough. xxxxs 的示例 - 我有一个 App ID # 和一个 Ad Unit Id #,但都不够长。 There 16 x placeholders for the numbers.数字有 16 个占位符。 From an email from Admob:来自 Admob 的 email:

Let's say my App ID # is: 1234567890假设我的 App ID # 是:1234567890

And Let's say my Ad Unit ID # is: 9876543210假设我的广告单元 ID # 是:9876543210

Both are 10 digits, not 16 so I figure they are not a match.两者都是 10 位数字,而不是 16 位,所以我认为它们不匹配。 When I go to my Admob account and look at Ad settings for the Interstitial ad I setup I see the following:当我将 go 转到我的 Admob 帐户并查看我设置的插页式广告的广告设置时,我看到以下内容:

Ad Unit ID: ca-app-pub-7777777777777777/5555555555广告单元 ID:ca-app-pub-7777777777777777/5555555555

Question - should I place that ad unit ID in my Manifest for real ads?问题 - 我应该将该广告单元 ID 放在我的清单中以用于真实广告吗? I also don't understand why the 2nd half of the Ad Unit ID differs from one that Admob emailed me.我也不明白为什么广告单元 ID 的后半部分与 Admob 通过电子邮件发送给我的不同。

5555555555 != 9876543210 5555555555 != 9876543210

And then in my MainActivity I had the test ad code:然后在我的 MainActivity 我有测试广告代码:

InterstitialAd.load(this,"ca-app-pub-3940256099942544/1033173712", adRequest,

As best as I can surmise is that for real ads I should replace the first portion:据我所知,对于真正的广告,我应该替换第一部分:

3940256099942544 3940256099942544

Which is for testing with the code from Ad Unit ID # from Admob settings:用于使用来自 Admob 设置的广告单元 ID # 中的代码进行测试:

7777777777777777 7777777777777777

And then after the forward slash replace the 1033173712 with the Ad Unit ID from the Admob email:然后在正斜杠之后将 1033173712 替换为 Admob email 中的广告单元 ID:

9876543210 9876543210

I think I need to get a real ad to display in testing before I upload the app to the Play Store for review.我认为在将应用程序上传到 Play 商店进行审核之前,我需要在测试中展示一个真实的广告。 I'm just really confused as which ID # to use and where.我真的很困惑使用哪个 ID # 以及在哪里使用。 I can wait for the account to to be approved to show ads - but I don't know if the ID #s are incorrect and that is reason why real ads don't show.我可以等待帐户获准展示广告 - 但我不知道 ID #s 是否不正确,这就是实际广告不展示的原因。 Any assistance would be really appreciated - this is the last step after 13 months of hard work.任何帮助将不胜感激 - 这是 13 个月辛勤工作后的最后一步。 Thanks.谢谢。

Use the App Id that you received (can be found on your AdMob dashboard also) in your AndroidManifest.xml instead of ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy .在您的AndroidManifest.xml中使用您收到的App Id (也可以在您的 AdMob 仪表板上找到),而不是ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy

Replace the "ca-app-pub-3940256099942544/1033173712" with your Ad Unit Id when loading Ads.加载广告时,将"ca-app-pub-3940256099942544/1033173712"替换为您的广告单元 ID

Note:笔记:

  1. App Id contains a ~ (tilde) in it. App Id 中包含一个~ (波浪号)。
  2. Ad Unit Id contain a / (forward slash).广告单元 ID 包含/ (正斜杠)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM