iOS SDK: Getting Started

Integrating myTarget SDK for iOS

  • Minimum supported iOS version - 12.4.
  • Xcode version 12.5 or higher.

Connecting using the Swift Package Manager

To add a dependency to your Xcode project, select File > Swift Packages > Add Package Dependency and enter the repository URL: https://github.com/myTargetSDK/mytarget-ios-spm

Add the '-ObjC' flag to Other Linker Flags on the Build Settings tab of your project.

Connecting using the CocoaPods

Add a dependency to your Podfile:

pod 'myTargetSDK'
Run 'pod install'.

Connecting using the Carthage

Starting with version 5.17.1, support for Carthage is available.

Add it to your Cartfile:

github "myTargetSDK/mytarget-ios" ~> 5.17.2 
Run carthage update --use-xcframeworks.

Add -ObjC flag to Other Linker Flags on Build Settings tab of your project.

Move the resulting MyTargetSDK.xcframework to the Frameworks and Libraries section of your project (Do not embed).

If you see Swift character linking errors, add an empty .swift file to your project.

Manual connecting

  1. Download latest version of myTarget iOS SDK and extract archive.
  2. Include the MyTargetSDK.framework from the unpacked archive into the project.
  3. Connect the CoreLocation, CoreTelephony, CoreMedia, SystemConfiguration, StoreKit, AdSupport, SafariServices and AVFoundation frameworks to your project.
  4. Add the '-ObjC' flag to the Other Linker Flags on the Build Settings tab of your project.
  5. If you see Swift character linking errors, add an empty .swift file to your project.

Mediation

If you plan to use mediation with the Mopub SDK, you need to attach the files for the corresponding SDK to the project from our Github repository's mediation directory.

Learn more

Was this article helpful?