Integrate Line with Mediation (Beta)

本指南将向您介绍如何使用 Google 移动广告 SDK 加载和展示 使用 中介、 包括广告瀑布流集成其中介绍了如何向广告单元的 中介配置,以及如何将 Line SDK 和适配器集成到 一款 iOS 应用。

Line 的信息中心界面使用日语文本作为标签, 按钮和说明本指南中的屏幕截图 。不过,在本指南的说明和说明中,标签和 相应按钮在翻译后会用英文括号括起来。

支持的集成和广告格式

Line 的中介适配器具有以下功能:

集成
出价
瀑布  1
表现形式
横幅
插页式广告
激励广告
原生

1 已集成瀑布流 封闭式 Beta 版,请联系您的客户经理以申请访问权限。

要求

  • iOS 部署目标为 12.0 或更高版本
  • 最新版 Google 移动广告 SDK

  • 完成中介流程 入门指南

第 1 步:在 Line 界面中设置配置

Log in to your Line account.

Add a new application

Click 広告枠管理 (Ad Slot Management) > メディア (Media). Then, click 新規作成 (Create New).

Fill out the form and click 登録 (Register).

Take note of the Application ID.

Create an ad placement

Click the ID of the application you want to add an ad placement. Then, select 詳細 (Detail).

Click スロット 追加 (Add Slot).

Fill out the form and once done, click (登録) Register.

Take note of the Slot ID.

第 2 步:在界面中设置 Ad Manager 订单项需求

Configure mediation settings for your ad unit

Sign in to your Ad Manager account.

Navigate to Delivery > Yield groups and click the New yield group button.

Enter a unique Name for your yield group, set the Status to Active, select your Ad Format, and set the Inventory type to Mobile App. Under the Targeting > Inventory section, select the ad unit under Inventory and Mobile application to which you want to add mediation.

Next, click the Add yield partner button.

If you already have a Yield partner for Line, you can select it. Otherwise, select Create a new yield partner.

Select Line as the Ad network, enter a unique Name and enable Mediation.

Once the Yield partner is selected, choose Mobile SDK Mediation as the Integration type, iOS as the Platform, and Active as the Status. Enter the Application ID and Slot ID obtained in the previous section. Then, enter a Default CPM value.

Click Save at the bottom of the page when done.

第 3 步:导入 Line SDK 和适配器

将以下代码行添加到项目的 Podfile 中:

pod 'GoogleMobileAdsMediationLine'

在命令行中运行以下命令:

pod install --repo-update

手动集成

  • 下载最新版 Line SDK 和关联 FiveAd.framework
  • 从以下位置的下载链接下载最新版本的线路适配器: 更新日志和 关联项目中的 LineAdapter.framework

第 4 步:添加所需的代码

SKAdNetwork 集成

按照 Line 的文档操作 将 SKAdNetwork 标识符添加到项目的 Info.plist 文件中。

第 5 步:测试实现效果

Enable test ads

Make sure you register your test device for Ad Manager.

Follow the instructions in Line's documentation on how to enable Line test ads.

Verify test ads

To verify that you are receiving test ads from Line, enable single ad source testing in ad inspector using the Line (Waterfall) ad source(s).

可选步骤

广告联盟专有参数

Line 适配器支持附加请求参数,该参数可以传递 适配器使用 GADMediationAdapterLineExtras 类。此课程 包含以下属性:

adAudio
指定横幅广告、插页式广告和 激励广告。

以下示例代码展示了如何创建可设置这些参数的广告请求:

Swift

import LineAdapter
// ...

let request = GAMRequest()
let extras = GADMediationAdapterLineExtras()
extras.adAudio = GADMediationAdapterLineAdAudio.unmuted
// ...
request.register(extras)

Objective-C

#import <LineAdapter/LineAdapter.h>
// ...

GAMRequest *request = [GAMRequest request];
GADMediationAdapterLineExtras *extras = [[GADMediationAdapterLineExtras alloc] init];
extras.adAudio = GADMediationAdapterLineAdAudioUnmuted;
// ...
[request registerAdNetworkExtras:extras];

使用原生广告

广告呈现

Line 适配器会填充以下内容 字段 针对 GADNativeAd

字段 素材资源始终包含在 Line Adapter 中
标题
映像
正文
应用图标 1
号召性用语
星级
商店
价格

1 对于原生广告,Line SDK 不提供应用图标资源。相反,Line 适配器会填充应用, 图标和透明图片

错误代码

如果适配器无法接收来自 Line 的广告,您可以检查 使用 GADResponseInfo.adNetworkInfoArray 分为以下类:

GADMediationAdapterLine

以下是 Line 适配器在以下情况下抛出的代码及其附带消息: 广告加载失败:

错误代码 网域 原因
1-10 com.five_corp.ad Line SDK 返回了与 SDK 相关的错误。请参阅 行的文档 了解详情。
101 com.google.ads.mediation.line 应用 ID 缺失或无效。
102 com.google.ads.mediation.line 广告位 ID 缺失或无效。
103 com.google.ads.mediation.line 请求的广告尺寸与 Line 支持的横幅广告尺寸不匹配。
104 com.google.ads.mediation.line 由于缺少活动上下文,未能加载插页式广告或激励广告。
105 com.google.ads.mediation.line Line SDK 无法展示插页式广告或激励广告。
106 com.google.ads.mediation.line 由于缺少素材资源,无法加载原生广告。
1-10 由 Line SDK 发送 Line SDK 返回了与 SDK 相关的错误。请参阅 行的文档 了解详情。
101 com.google.ads.mediation.line 服务器参数无效(例如,缺少应用 ID 或插槽 ID)。
102 com.google.ads.mediation.line 请求的广告尺寸与 Line 支持的横幅广告尺寸不匹配。
103 com.google.ads.mediation.line 未能在原生广告中加载信息图标图片素材资源。

LINE iOS 中介适配器更新日志

版本 2.8.20240612.0

  • 通过 GADVideoOptions 为原生广告添加了音频控件。
  • 已验证与 FiveAd SDK 版本 2.8.20240612 的兼容性。

构建和测试时所用平台:

  • Google 移动广告 SDK 11.5.0 版。
  • FiveAd SDK 版本 2.8.20240612。

版本 2.7.20240411.0

  • 已验证与 FiveAd SDK 版本 2.7.20240411 的兼容性。

构建和测试时所用平台:

  • Google 移动广告 SDK 11.3.0 版。
  • FiveAd SDK 版本 2.7.20240411。

版本 2.7.20240318.0

  • 已验证与 FiveAd SDK 版本 2.7.20240318 的兼容性。

构建和测试时所用平台:

  • Google 移动广告 SDK 11.2.0 版。
  • FiveAd SDK 版本 2.7.20240318。

版本 2.7.20240214.1

  • 现在要求最低 iOS 版本为 12.0。
  • 现在需要 Google 移动广告 SDK 11.0 或更高版本。
  • LineAdapter.xcframework 的框架中添加了 Info.plist

构建和测试时所用平台:

  • Google 移动广告 SDK 11.0.1 版。
  • FiveAd SDK 版本 2.7.20240214。

版本 2.7.20240214.0

  • 已验证与 FiveAd SDK 版本 2.7.20240214 的兼容性。

构建和测试时所用平台:

  • Google 移动广告 SDK 11.0.1 版。
  • FiveAd SDK 版本 2.7.20240214。

版本 2.7.20240126.0

  • 已验证与 FiveAd SDK 版本 2.7.20240126 的兼容性。
  • 使用 FiveAd SDK 新的代理协议更新了适配器实现。

构建和测试时所用平台:

  • Google 移动广告 SDK 10.14.0 版。
  • FiveAd SDK 版本 2.7.20240126。

版本 2.7.20231115.0

  • 已验证与 FiveAd SDK 版本 2.7.20231115 的兼容性。
  • 在 modulemap 中添加了 GADMediationAdapterLineExtras 头文件。

构建和测试时所用平台:

  • Google 移动广告 SDK 10.14.0 版。
  • FiveAd SDK 版本 2.7.20231115。

版本 2.6.20230609.1

  • 添加了 GADMediationAdapterLineAudioState,用于管理横幅广告、插页式广告和激励广告首次展示时的初始音频状态。

构建和测试时所用平台:

  • Google 移动广告 SDK 10.14.0 版。
  • FiveAd SDK 版本 2.6.20230609。

版本 2.6.20230609.0

  • 初始版本!
  • 为横幅广告、插页式广告、激励广告和原生广告格式添加了广告瀑布流支持。
  • 已验证与 FiveAd SDK 版本 2.6.20230609 的兼容性。

构建和测试时所用平台:

  • Google 移动广告 SDK 10.9.0 版。
  • FiveAd SDK 版本 2.6.20230609。