> For the complete documentation index, see [llms.txt](https://aatkit.gitbook.io/rtbsdk-ios-integration/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aatkit.gitbook.io/rtbsdk-ios-integration/start/setup/swift-package-manager.md).

# Swift Package Manager

Add RTBSDK to your app using Swift Package Manager

Starting with version **1.10.1**, RTBSDK's Swift Package Manager distribution is split into three separate packages. Always add the **Core SDK**, and add a mediation adapter package only for the networks you actually mediate.

{% hint style="info" %}
This split affects **Swift Package Manager only**. [CocoaPods](/rtbsdk-ios-integration/start/setup/cocoapods.md) integration is unchanged.
{% endhint %}

### Packages <a href="#packages" id="packages"></a>

| Package              | Repository                                    | Library to link                          | When to add                                                                                                        |
| -------------------- | --------------------------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| **Core SDK**         | <https://github.com/AddApptr/RTBSDK>          | `RTBSDK`                                 | Always — required for every integration. Contains `RTBSDK` and `OMSDK_Addapptr`, with no third-party dependencies. |
| **AppLovin adapter** | <https://github.com/AddApptr/RTBSDK-AppLovin> | `RTB_GraviteRTBAppLovinMediationAdapter` | Only if you mediate AppLovin.                                                                                      |
| **AdMob adapter**    | <https://github.com/AddApptr/RTBSDK-AdMob>    | `RTB_GraviteRTBAdMobMediationAdapter`    | Only if you mediate AdMob.                                                                                         |

Each adapter package depends on the Core SDK and on its matching third-party SDK (AppLovin or Google Mobile Ads). Adding an adapter therefore resolves those dependencies for you — you do not need to add the Core SDK or the third-party SDK separately.

### Integration Steps <a href="#integration-steps" id="integration-steps"></a>

* Open your Xcode project, navigate to the **File** menu in the macOS bar, and click **Add Package Dependencies…**.
* In the URL field, enter the repository URL of the package you want to add. Start with the **Core SDK**: <https://github.com/AddApptr/RTBSDK>.
* Set the **Dependency Rule** to **"Exact Version"** and specify the desired RTBSDK version (refer to the [release notes](https://aatkit.gitbook.io/rtbsdk-release-notes) for the latest stable version).
* Click **Add Package** and wait for the package to finish fetching.
* When prompted to choose a target, add the package's library product to your app target:
  * Core SDK → `RTBSDK`
  * AppLovin adapter → `RTB_GraviteRTBAppLovinMediationAdapter`
  * AdMob adapter → `RTB_GraviteRTBAdMobMediationAdapter`
* Repeat these steps for each mediation adapter you need.
* Make sure the library products you added appear under **"Frameworks, Libraries, and Embedded Content"** of your app target.

{% hint style="warning" %}
Use the **same exact version** for the Core SDK and every adapter you add. Mixing versions can lead to dependency resolution conflicts.
{% endhint %}

{% hint style="info" %}
You have to add `-ObjC` to your build settings (Other Linker Flags) by following these steps:

* Click on the project navigator.
* Click on your target and build settings.
* Search for "other linker flags".
* Add `-ObjC`.
  {% endhint %}
