Get Started with Avocarrot

Overview

Examples

Android

Overview

Getting Started

- Integrating Ads

Stream

Native Assets

Banner

Interstitial

Video

- Others

Troubleshooting

- Adapters

Admob Android Adapter

Mopub Android Adapter

iOS

Overview

Getting Started

- Integrating Ads

Stream

Native Assets

Banner

Interstitial

Video

- Others

Troubleshooting

- Adapters

Admob iOS Adapter

Mopub iOS Adapter

API Documentation

Reporting API

Help

Supported Networks & Ad Types

General

Earnings

Payments and Accounting

Integration

Reporting

Mediation Network Optimization

Legal and Privacy

Updates

SDK Change Log

Android Change Log

iOS Change Log

Getting Started

Updated 6 days ago ​by Chris

Overview

This tutorial helps you install the Avocarrot SDK in your iOS app.

You need an Avocarrot account to complete the tutorial. Create an account

Initialization

Avocarrot iOS SDK supports iOS 8.0 or higher.

You can add AvocarrotSDK to your project using Cocoapods  (recommended) or manually

Note: If you don’t have pods in your project, set them up using the Getting Started guide
  1. Add pod ‘avocarrot-ios-sdk’ to your Podfile to integrate it to your project
  2. Add the ad types you require to your Podfile:


    Ad type Server to Server networks onlyfull (ALL mediated networks)
    Native Asset Default in avocarrot-ios-sdkpod 'avocarrot-ios-sdk/NativeAssetsAdapters'
    Streampod ‘avocarrot-ios-sdk/NativeView’pod 'avocarrot-ios-sdk/NativeViewAdapters'
    Banner pod ‘avocarrot-ios-sdk/Banner’pod 'avocarrot-ios-sdk/BannerAdapters'
    Interstitial pod ‘avocarrot-ios-sdk/Interstitial’pod 'avocarrot-ios-sdk/InterstitialAdapters'
    Video pod ‘avocarrot-ios-sdk/Video’pod 'avocarrot-ios-sdk/VideoAdapters'
  3. To add only individual network and not the full package: (optional)

    Admob

    Ad type PodLine
    Native Asset pod 'avocarrot-ios-sdk/NativeAssetsAdapters/GoogleMobileAdsAdapter'
    Streampod 'avocarrot-ios-sdk/NativeViewAdapters/GoogleMobileAdsAdapter'
    Banner pod 'avocarrot-ios-sdk/BannerAdapters/GoogleMobileAdsAdapter'
    Interstitial pod 'avocarrot-ios-sdk/InterstitialAdapters/GoogleMobileAdsAdapter'

    Facebook Audience

    Ad type PodLine
    Native Asset pod 'avocarrot-ios-sdk/NativeAssetsAdapters/FBAudienceAdapter'
    Streampod 'avocarrot-ios-sdk/NativeViewAdapters/FBAudienceAdapter'
    Banner pod 'avocarrot-ios-sdk/BannerAdapters/FBAudienceAdapter'
    Interstitial pod 'avocarrot-ios-sdk/InterstitialAdapters/FBAudienceAdapter'

    Mopub

    Ad type PODLINE
    Native Asset pod 'avocarrot-ios-sdk/NativeAssetsAdapters/MopubAdapter'
    Streampod 'avocarrot-ios-sdk/NativeViewAdapters/MopubAdapter'
    Banner pod 'avocarrot-ios-sdk/BannerAdapters/MopubAdapter'
    Interstitial pod 'avocarrot-ios-sdk/InterstitialAdapters/MopubAdapter'

    Applovin

    Ad type podline
    Native Asset pod 'avocarrot-ios-sdk/NativeAssetsAdapters/AppLovinAdapter'
    Streampod 'avocarrot-ios-sdk/NativeViewAdapters/AppLovinAdapter'
    Interstitial pod 'avocarrot-ios-sdk/InterstitialAdapters/AppLovinAdapter'

    InLoco

    Ad type podline
    Native Asset pod 'avocarrot-ios-sdk/NativeAssetsAdapters/InLocoAdapter'
    Streampod 'avocarrot-ios-sdk/NativeViewAdapters/InLocoAdapter'
    Banner pod 'avocarrot-ios-sdk/BannerAdapters/InLocoAdapter'
    Interstitial pod 'avocarrot-ios-sdk/InterstitialAdapters/InLocoAdapter'

    Chartboost

    Ad type Line
    Interstitial pod 'avocarrot-ios-sdk/InterstitialAdapters/ChartboostAdapter'
    Video pod 'avocarrot-ios-sdk/VideoAdapters/ChartboostAdapter'

    NativeX

    Ad type Line
    Interstitial pod 'avocarrot-ios-sdk/InterstitialAdapters/NativeXAdapter'
    Video pod 'avocarrot-ios-sdk/VideoAdapters/NativeXAdapter'

    UnityAds

    Ad type Line
    Video pod 'avocarrot-ios-sdk/VideoAdapters/UnityAdsAdapter'

We also have sample code available at our GitHub repository.

Manual Avocarrot SDK integration guide

FrameworkDescription
AvocarrotCore.frameworkCore functionality; provides access to main SDK settings
AvocarrotNativeAssets.frameworkProvides access to raw native data
AvocarrotNativeView.frameworkProvides access to rendered native ads
Vast.frameworkImplementation of VAST
Mraid.frameworkImplementation of MRAID


  1. Add SDK files to your project (required)
    Ad type Frameworks
    Banners AvocarrotCore.framework, AvocarrotBanner.framework, Mraid.framework
    Interstitial AvocarrotCore.framework, AvocarrotInterstitial.framework, Mraid.framework
    Video AvocarrotCore.framework, AvocarrotVideo.framework, Vast.framework
    Native assets AvocarrotCore.framework, AvocarrotNativeAssets.framework
    Native view (rendered native ad) AvocarrotCore.framework, AvocarrotNativeAssets.framework, AvocarrotNativeView.framework, Vast.framework
  2. Add -ObjC flag to project settings (Other Linker Flags property)  

    Note: If your app can’t use -ObjC flag just add -force_load $(PROJECT_DIR)/Pods/avocarrot-ios-sdk/AvocarrotSDK.framework/Versions/Current/AvocarrotSDK flag to Other Linker Flags

  3. Required system libraries for all libs

    The SDK with adapters uses the following system frameworks and libraries. You can set flag “Link Frameworks automatically” to YES otherwise you should add following system frameworks and libraries to your project manually:

    WebKit

    Security

    QuickLook

    MobileCoreServices

    CoreText

    AssetsLibrary

    Foundation

    CoreData

    Social

    MessageUI

    MediaPlayer

    EventKit

    EventKitUI

    QuartzCore

    CoreMedia

    CFNetwork

    SystemConfiguration

    CoreGraphics

    StoreKit

    CoreTelephony

    AVFoundation

    AdSupport

    AudioToolbox

    UIKit

    libxml2

    libsqlite3

    libz

Warning: Some Xcode versions support new settings only after the Xcode reboot. This also cleans the Xcode cache and remedies other problems.

TO DO list if you have a linking problem:

  • Clean Build
  • Restart Xcode
  • Delete your DerivedData folder in ~/Library/Developer/Xcode/DerivedData
  • Restart the computer

ATS settings in iOS 9.0 and greater

Since the Avocarrot SDK uses 3rd party networks to load ads and we have no control over these networks loading their content via https, you should disable ATS for your application to ensure the Avocarrot SDK behaves as intended. To disable ATS add the following settings to your application Info.plist file:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key><true/>
    <key>NSAllowsArbitraryLoadsForMedia</key><true/>
    <key>NSAllowsArbitraryLoadsInWebContent</key><true/>
</dict>

Next Steps

Choose an ad format

You're ready to implement an ad. Avocarrot Exchange offers a number of native ad formats, so you can choose the one that best fits your app's user experience.


Was this article useful?