启用 Google

支持的广告格式

集成

  1. 在 Yandex Advertising Network 界面和您的广告网络账户中配置聚合。

  2. 将依赖项添加到应用级别的 build.gradle.kts 文件中的 androidMain.dependencies 块:

    implementation("com.yandex.android:mobileads:8.7.1")
    implementation("com.yandex.ads.mediation:mobileads-google:1.3.1.0")
    
  3. 使用名为 com.google.android.gms.ads.APPLICATION_ID 的 <meta-data> 计数器将应用的 AdMob ID 添加到 AndroidManifest.xml 文件中(要了解如何查找 AdMob Id,请参阅,请参阅 Google 帮助中心)。

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

备注

要在移动聚合中跟踪应用安装,您需要为适配器配置 Info.plist。 请按照广告网络 文档 进行操作。

要使用 Google,您需要添加 GoogleYandexMobileAdsAdapters 库。

GoogleYandexMobileAdsAdapters 库已经适配了 CocoaPods 依赖管理系统,并支持静态集成。

  1. 在 Yandex Advertising Network 界面和您的广告网络账户中配置聚合。

  2. 要连接库,请将依赖项添加到项目的 Podfile 中:

    pod 'GoogleYandexMobileAdsAdapters', '13.11.0.1'
    
  3. 在您的应用的 Info.plist 文件中,添加 GADApplicationIdentifier 键,并将其值设置为您的 AdMob ID。 详细了解在何处可以 找到 AdMob ID。

    <key>GADApplicationIdentifier</key>
    <string>ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy</string>
    
上一篇
下一篇