기술 자료

Unity Ads Monetization

Unity Ads Monetization

Install the Unity Ads SDK for iOS

Install the Unity Ads SDK in your iOS project. Add the SDK through Swift Package Manager, CocoaPods, or manual integration, and configure your Xcode project as needed.
읽는 시간 3분최근 업데이트: 3일 전

To install Unity Ads, you can use Swift Package Manager (recommended), CocoaPods for UnityAds, or you can manually install Unity Ads.

Swift Package Manager

Swift Package Manager (SPM) is the recommended way to install the Unity Ads SDK. Unity Ads SDK versions later than 4.22.0 are available only through SPM.
To add the package in Xcode:
  1. Go to File > Add Package Dependencies.
  2. Enter the following package URL:
    https://github.com/Unity-Technologies/Unity-Ads-Swift-Package
  3. Select the SDK version, and then add the Unity Ads Swift package library to your app target.
To add the package in a Swift package manifest, add the following dependency to your
Package.swift
file:
dependencies: [ .package(url: "https://github.com/Unity-Technologies/Unity-Ads-Swift-Package", from: "4.22.0")]
For details of the Xcode workflow, refer to Apple's Adding package dependencies to your app documentation.
If your project currently uses CocoaPods, refer to Migrate the Unity Ads SDK from CocoaPods to Swift Package Manager.

CocoaPods

중요
CocoaPods Trunk becomes read-only on December 2, 2026. Unity Ads SDK versions later than 4.22.0 aren't published to CocoaPods. To continue receiving SDK updates, migrate to Swift Package Manager before that date.
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 interoperability

  • 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.