Google 集成

支持的广告格式

集成

  1. 在 Yandex 合作伙伴界面和其他网络界面中 设置聚合

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

    implementation 'com.yandex.android:mobileads:7.5.0'
    implementation 'com.yandex.ads.mediation:mobileads-google:23.2.0.0'
    
  3. 使用名为 com.google.android.gms.ads.APPLICATION_ID 的 <meta-data> 标记将 AdMob ID 添加到应用的 AndroidManifest.xml 文件中(详细了解如何 查找 AdMob ID)。

    <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 合作伙伴界面和其他网络界面中 设置聚合

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

    pod 'GoogleYandexMobileAdsAdapters', '11.7.0.1'
    
  3. 在应用的 Info.plist 文件中,添加字符串值为 AdMob IDGADApplicationIdentifier 键(详细了解如何 查找 AdMob ID)。

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