To install Unity Ads, you can use CocoaPods for UnityAds or you can manually install Unity Ads.
CocoaPods
To use CocoaPods for UnityAds:
- Add the following line to your project's Podfile:
pod 'UnityAds'
- Run the following command:
pod install
Manual installation
To manually install Unity Ads:
- Download the Unity Ads framework from the Assets section of your preferred SDK release. It's recommended to download the latest SDK to ensure you have the best available support.
- Drag and drop the Unity Ads framework into your workspace.
Swift
Starting in SDK version 4.4.0, Unity Ads has been optimized by using the Swift programming language.
- 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.
- To fix this, ensure that you set Always embed Swift standard libraries to
Next steps
To continue your integration, refer to the Initialize the SDK in iOS documentation.