For the complete documentation index, see llms.txt.

Migrate from CocoaPods to Swift Package Manager

CocoaPods is no longer supported for integrating the CSQ iOS SDK in your app.

If you stay on CocoaPods, you will stop receiving SDK updates. Migrate to Swift Package Manager to continue receiving new features and fixes.

  • Xcode 16.0 or later is required.
  • Make sure you have an up-to-date copy of your project in source control before starting.

1. Remove the Contentsquare SDK from your Podfile

Section titled 1. Remove the Contentsquare SDK from your Podfile

Open your Podfile and remove the Contentsquare SDK pod reference:

pod 'ContentsquareSDK'

Then run pod install to update your project:

Terminal window
pod install

2. Add the Contentsquare SDK via Swift Package Manager

Section titled 2. Add the Contentsquare SDK via Swift Package Manager
  1. In Xcode, go to File > Add Packages….

  2. Enter the following repository URL:

    https://github.com/ContentSquare/apple-sdk.git
  1. Set the Dependency Rule to Exact Version 1.10.0.
  1. Click Add Package.

To ensure the SDK starts correctly, add -ObjC as a linker flag:

  1. In your target's Build Settings, search for Other Linker Flags.
  2. Add -ObjC.

4. Remove leftover SwiftProtobuf dependency

Section titled 4. Remove leftover SwiftProtobuf dependency

If you previously added pod 'SwiftProtobuf' to work around a known CocoaPods issue, remove that reference from your project. SwiftProtobuf is included automatically via SPM.

Also remove https://github.com/apple/swift-protobuf.git from Package Dependencies if you had added it before SDK version 4.35.1.

Build your project. If the build succeeds and the SDK initializes correctly, the migration is complete.

If you want to fully remove CocoaPods

Section titled If you want to fully remove CocoaPods

If you're not using CocoaPods for any other dependencies and want to completely remove it from your project:

  1. Run pod deintegrate in your project directory.
  2. Delete Podfile and Podfile.lock.
  3. Open the .xcodeproj file directly instead of the .xcworkspace.

If you see an error like:

dyld: Symbol not found: _OBJC_CLASS_$_...

Make sure the -ObjC linker flag is present under Build Settings > Linking > Other Linker Flags for your app target.

Module not found at build time

Section titled Module not found at build time

If Xcode cannot find the ContentsquareModule import, check that the ContentsquareSDK package is listed under your target's Frameworks, Libraries, and Embedded Content in the General tab.