Unity SDK: Getting Started

Integration myTarget SDK for Unity

Unity plugin supports interstitial ads and 320x50, 300x250 and 728x90 banners for iOS and Android platforms.

Minimum supported Unity version - 5.0.

Minimum supported OS versions: iOS 7.0, Android 4.0.

  1. Download myTarget SDK Unity.
  2. Import package myTarget.unitypackage into your project.
For Android projects we recommend to connect to the project the Google Play Services library (module Mobile Ads com.google.android.gms:play-services-basement), it will allow to better target Ads with Google Advertising ID.

Integration MoPub Unity

General

1. Download https://github.com/mopub/mopub-unity-sdk/releases
2. Import to the project
3. Add myTarget dependencies into MoPub/Scripts/Editor/MoPubDependencies.xml
<androidPackage spec="com.my.target:mytarget-sdk:LAST_VERSION_ANDROID" />
<iosPod name="myTargetSDK" version="LAST_VERSION_IOS" bitcodeEnabled="true" minTargetSdk="9.0" />
LAST_VERSION is to be replaced by myTarget latest OS SDK version

Android Unity - Mopub

  1. Execute Assets -> External Dependency Manager -> Android Resolver -> Force Resolve
  2. Create a directory MyTarget -> Android
  3. Copy https://github.com/myTargetSDK/mytarget-android/tree/master/mediation/mopub to MyTarget -> Android
  4. Specify correct slot id's
  5. Build the project
In case of build error using Gradle "Execution failed for task ':transformDexArchiveWithExternalLibsDexMergerForRelease'." It's required to switch on minify: Player Settings -> Publishing Settings -> Minify and choose "Gradle" for Release/Debug

iOS Unity - MoPub

  1. Create MyTarget -> iOS directory
  2. Copy https://github.com/myTargetSDK/mytarget-ios/tree/m... to MyTarget -> iOS
  3. Generate xCode project
  4. Modify Podfile – delete subspecs => ['Core'] in 'mopub-ios-sdk'
  5. Execute pod install in xCode project directory
  6. Build the project
  7. Adapter current version has a problem with h-files import. To remove the compilation error, modify correct heading import.
Was this article helpful?
Yes
No