我们可以在Android应用程序中使用Web视图使用Adsense吗

Ris*_*wal 3 android adsense admob android-webview android-studio

我有一个网站,其中有 AdSense 广告,现在我制作了一个 Android 应用程序并使用网络视图集成了该网站,现在 AdSense 广告也显示在该应用程序上。那么,是否允许在android应用程序上使用这些AdSense广告,或者我们只能使用AdMob添加

aga*_*ggi 8

最近,Google 允许在 webview(Android 和 iOS)中使用 Adsense 广告。 https://support.google.com/adsense/answer/11893859?hl=zh-CN

在 Google Mobile Ads SDK 20.6.0 版本中,添加了使用 webview 技术的 Adsense 支持。现在,它允许使用 webview 作为主要视图的应用程序在 webview 中使用 Adsense 展示广告。

您需要集成Webview API for Ads - AndroidWebview API for Ads - iOS

例如在 Android 中,

在 app/build.gradle 中添加依赖

dependencies {
  implementation 'com.google.android.gms:play-services-ads:21.3.0'
}
Run Code Online (Sandbox Code Playgroud)

在 AndroidManifest.xml 中添加以下行以绕过 APPLICATION_ID 检查

<meta-data
      android:name="com.google.android.gms.ads.INTEGRATION_MANAGER"
      android:value="webview"/>
Run Code Online (Sandbox Code Playgroud)

在 onCreate 生命周期方法中添加以下行

MobileAds.registerWebView(webView);
Run Code Online (Sandbox Code Playgroud)