SDK Configuration
1. Import ToBid SDK
选择需要接入的第三方广告网络,创建应用并拿到聚合SDK所需的参数,详细信息可查看【第三方广告网络操作指南】
Select the third-party advertising network you want to access, create an application and obtain the parameters required by the aggregation SDK. For detailed information, please refer to the [Third-Party Advertising Network Operation Guide]聚合SDK依赖于ToBid广告SDK,故使用前必须集成广告SDK。否则,可能会有编译不通过等问题。
The aggregation SDK depends on the ToBid advertising SDK, so the advertising SDK must be integrated before use. Otherwise, there may be problems such as compilation failure.可下载我们提供的ToBid聚合示例Demo,查看完整的接入代码【点击查看】
You can download the ToBid example Demo provided by us to view the complete access code【view】
1.1. Import framework
获取相应版本的framework库,导入项目工程即可。
Get the corresponding version of the framework library and import the project.
必须导入的库 Libraries that must be imported:
WindFoundation.xcframework
WindSDK.xcframework
WindMillSDK.xcframework
三方SDK根据需要,导入对应的SDK和适配器即可。详细请查看【第三方广告网络配置说明】
The third-party SDK can import the corresponding SDK and adapter as needed.Reference【3rd Configurations】
1.2. cocoapod引入 Introduction of cocoapod
在podfile文件中添加:
Add in podfile:
#核心库,必须添加 must be added core
pod 'ToBid-iOS'
# 各平台的Adapter和sdk根据需要自行选择导入,参考下方PodCode
# Adapter and sdk of each platform can be imported according to their own needs, refer to the PodCode below| Network | Pod Code |
|---|---|
| ToBid | pod 'ToBid-iOS' |
| Admob | pod 'ToBid-iOS/AdmobAdapter' |
| AppLovin | pod 'ToBid-iOS/AppLovinAdapter' |
| Baidu | pod 'ToBid-iOS/BaiduAdapter' |
| ByteDance | pod 'ToBid-iOS/TouTiaoAdapter' |
| Tencent | pod 'ToBid-iOS/GDTAdapter' |
| IronSource | pod 'ToBid-iOS/IronSourceAdapter' |
| Klevin | pod 'ToBid-iOS/KlevinAdapter' |
| Kuaishou | pod 'ToBid-iOS/KSAdapter' |
| Mintegral | pod 'ToBid-iOS/MintegralAdapter' |
| UnityAds | pod 'ToBid-iOS/UnityAdsAdapter' |
| Vungle | pod 'ToBid-iOS/VungleAdapter' |
当导入某个适配器时,会自动通过pod下载对应渠道的SDK,由于Adapter和第三方广告SDK会存在版本兼容问题,所以我们建议通过pod Adapter的方式去依赖第三方广告SDK来确保不会有任何的版本兼容问题。
When an adapter is imported, the SDK of the corresponding channel will be automatically downloaded through the pod. Since there may be version compatibility issues between the Adapter and the third-party advertising SDK, we recommend relying on the third-party advertising SDK through the pod Adapter to ensure that there will be no version compatibility issues.
如果您想要引入特定版本的SDK则需要在pod 语句后面添加版本号(以1.0.0版本为例)、例如: pod 'ToBid-iOS', '1.5.0'
If you want to import a specific version of the SDK, you need to add the version number after the pod statement (take version 1.0.0 as an example), for example: pod 'ToBid-iOS', '1.5.0'
2. Xcode编译选项设置 Xcode compile option settings
2.1. Other Linker Flags
在Xcode中选择项目的Targets->Build Settings,配置Other Linker Flags 增加 -ObjC。
Select Targets->Build Settings of the project in Xcode, configure Other Linker Flags and add -ObjC .
2.2. 添加HTTP权限 Add HTTP permissions
工程plist文件设置,点击右边的information Property List后边的 "+" 展开
Project plist file settings, click the "+" behind the information Property List on the right to expand
添加 App Transport Security Settings,先点击左侧展开箭头,再点右侧加号,Allow Arbitrary Loads 选项自动加入,修改值为 YES。 SDK API 已经全部支持HTTPS,但是广告主素材存在非HTTPS情况。
To add 【App Transport Security Settings】, first click the left arrow to expand, then click the right plus sign, the Allow Arbitrary Loads option is automatically added, and the modified value is YES. All SDK APIs already support HTTPS, but advertiser creatives are not HTTPS.
注意:Allow Arbitrary Loads in Web Content key存在时会忽略Allow Arbitrary Loads的设置(iOS10之后)
Note: The Allow Arbitrary Loads setting will be ignored when the Allow Arbitrary Loads in Web Content key exists (after iOS10)
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>2.3. 添加定位权限 Add location permission
该权限非必须,sdk不包含任何请求定位权限的代码,也不会主动请求定位权限。
This permission is not required. The sdk does not contain any code that requests location permission, nor does it actively request location permission.
工程info.plist文件设置,点击右边的information Property List后边的 "+" 展开 添加Privacy - Location When In Use Usage Description。
Project info.plist file settings, click the "+" behind the information Property List on the right to expand and add Privacy - Location When In Use Usage Description.
2.4. 运行环境配置 Operating Environment Configuration
支持系统 iOS 9.0 及以上;
SDK编译环境 Xcode 12.0 + ;
支持架构:x86-64, armv7, arm64
Support system iOS 9.0 and above;
SDK compilation environment Xcode 12.0 + ;
Supported Architectures: x86-64, armv7, arm64
2.5. 添加依赖库 Add dependency library
工程需要在TARGETS -> Build Phases中找到Link Binary With Libraries,点击“+”,依次添加下列依赖库
The project needs to find Link Binary With Libraries in TARGETS -> Build Phases, click "+", and add the following dependent libraries in turn
- StoreKit.framework
- CFNetwork.framework
- CoreMedia.framework
- AdSupport.framework
- CoreMotion.framework
- MediaPlayer.framework
- CoreGraphics.framework
- AVFoundation.framework
- CoreLocation.framework
- CoreTelephony.framework
- SafariServices.framework
- MobileCoreServices.framework
- WebKit.framework
- SystemConfiguration.framework
- AdSupport.framework
- ImageIO.framework
- AudioToolbox.framework
- DeviceCheck.framework
- libc++.tbd
- libz.tbd
- libbz2.tbd
- libsqlite3.tbd