文档

​
​

Development

User Acquisition

Monetization

工业

Unity Ads Monetization

SDK 4.20.0

受支持
​

iOS API reference - Swift

iOS API reference - Objective-C

Unity Ads Monetization

SDK 4.20.0

受支持
​

此页面不支持所选语言。
iOS developer guides
​
​
iOS developer guides
  • iOS SDK integration guide
  • Unity Ads privacy guide
  • Unity Ads SDK troubleshooting guide
  • iOS developer API references - Swift
  • iOS developer API references - Objective-C
  1. Unity Ads SDK iOS developer monetization
  2. Unity Ads SDK integration guide for iOS developers

Install the Unity Ads SDK for iOS

Install the Unity Ads SDK in your iOS project. Add the SDK through CocoaPods or manual integration, and configure your Xcode project as needed.
阅读时间2 分钟
最后更新于 1 个月前

To install Unity Ads, you can use CocoaPods for UnityAds or you can manually install Unity Ads.

CocoaPods

To use CocoaPods for UnityAds:
  1. Add the following line to your project's Podfile:
    pod 'UnityAds'
  2. Run the following command:
    pod install

Manual installation

To manually install Unity Ads:
注意
This integration method requires that you set the Framework Search Paths and Header Search Paths properties in your Build settings.
  1. Download the Unity Ads framework from the Assets section of your preferred SDK release. The recommended best practice is to download the latest SDK to ensure you have the best available support.
  2. Drag and drop the Unity Ads framework into your workspace.
重要
Projects that target users running iOS 14 or later must implement Unity Ads' network ID in the information property list file (
Info.plist
).

Swift

Use the Swift Package Manager as your dependency manager in Swift projects.
  • If your project already uses Swift, then no further action is required.
  • If your project does not use Swift, add an empty Swift file to your project in Xcode by selecting File > New > Swift file.

Troubleshooting Swift interoperability errors

The following list details common Swift interoperability issues that could occur during the Unity Ads SDK installation:
  • Xcode emits many
    Undefined symbol_swift_FORCE_LOAD$_
    errors.
    • To fix this, add an empty Swift file to your project in Xcode by selecting File > New > Swift file.
  • The application crashes after start with the error:
    dyld: Library not loaded: @rpath/libswiftCore.dylib
    • To fix this, ensure that you set Always embed Swift standard libraries to
      YES
      under Build settings for your application's target in Xcode.

Next steps

To continue your integration, refer to the Initialize the SDK in iOS documentation.

Copyright © 2026 Unity Technologies
法律信息隐私政策CookiesDocumentation Terms of Use请勿出售或分享我的个人信息您的隐私选择(Cookie 设置)

“Unity”、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属公司在美国和其他地方的商标或注册商标(此处查看更多信息)。其他名称或品牌是其各自所有者的商标。

为方便起见,一些页面是机器翻译的,可能包含不准确的内容。如有信息不一致的情况,以英文版本为准。

  • 在本页上
    • CocoaPods

    • Manual installation

    • Swift

      • Troubleshooting Swift interoperability errors

    • Next steps


报告此页面的问题