First Steps

iOS Classic - First Steps

πŸ“

You are viewing the V3 docs. (For the V2 docs, go here.)


βœ…

While reading the documentation, take a look at our Sample App.

🚧

Xcode 13.1

A known issue in Xcode 13.0 occasionally prevents smooth scrolling on iOS 15 devices.

This can affect users making fast-fling gestures through the Taboola Feed.

To address this, publishers are advised to use Xcode 13.1 or higher.

πŸ“˜

The following steps are required for both Classic and Web integrations.

Installation overview

  1. Install the Taboola SDK, using either one of the following dependency managers:
  • CocoaPods
  • Carthage
  1. (Recommended) Add the SKAdNetwork ID for Taboola (requires Taboola SDK 3.2.0 or higher).

Flow 1: Install with CocoaPods

Install CocoaPods on your system

If not already present, install CocoaPods on your system:

  1. Run the following command from the Terminal:
$ sudo gem install cocoapods
  1. Wait for the installation to complete. Then run the following command to complete the setup:
pod setup --verbose

πŸ“˜

The above installation is required once per system.

Install Taboola SDK for your project

  1. Using the Terminal, navigate to your iOS project directory and run the following command:
$ pod init

πŸ“˜

This creates a Podfile for your project.

  1. Using a text editor, open your Podfile. Add the Taboola SDK dependency, with an exact version number - and save:
target 'DemoProject' do
 
  # Comment out the next line if you're not using Swift and you don't want to use dynamic frameworks.
  use_frameworks!

  # Taboola SDK
  pod 'TaboolaSDK', '<<iosSDKVersion>>'

end

🚧

Make sure to indicate the latest version - e.g. <<iosSDKVersion>>.

  1. Using the Terminal, navigate to your iOS project directory and install the Taboola SDK:
$ pod install
  1. Quit Xcode and open the newly created workspace file - e.g. DemoProject.xcworkspace.

🚧

From this point onward, use the workspace (.xcworkspace) file, not the project (.xcodeproj) file.

πŸ“˜

Update vs Install

If you already installed the Taboola SDK and just need to update the version - e.g. from 3.3.0 to 3.4.0 - you can use the update command:

  1. Edit the Podfile (as described above) and change the version number.
  2. Run: pod update.

See: pod install vs. pod update


Flow 2: Install with Carthage

Install Carthage on your system

If not already present, install Carthage on your system:

  1. From the Terminal, use Homebrew to install Carthage:
$ brew update
$ brew install carthage

πŸ“˜

This installation is required once per system.

Install Taboola SDK for your project

  1. Using a text editor, open your Catfile. Add the Taboola SDK dependency, with an exact version number - and save:
binary "https://cdn.taboola.com/taboola-mobile-sdk/ios/carthage/TaboolaSDK.json" == <<iosSDKVersion>>

🚧

Make sure to indicate the latest version - e.g. <<iosSDKVersion>>.

  1. Run carthage update to build the framework - then drag TaboolaSDK.framework into your Xcode project.

  2. On your application target Build Phases settings tab, click the + icon and select New Run Script Phase.

a. Create a Run Script in which you specify your shell (ex: /bin/sh)
b. Add the following contents to the script area below the shell:

$ /usr/local/bin/carthage copy-frameworks

c. Add the paths to the frameworks you want to use under β€œInput Files". For example:

$(SRCROOT)/Carthage/Build/iOS/TaboolaSDK.framework

d. Add the paths to the copied frameworks to the β€œOutput Files”. For example:

$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/TaboolaFramework.framework

Add the skAdNetwork ID for Taboola

With the release of iOS 14, you need to include the IDs of all your Ad Networks in Info.plist.

🚧

Requires Taboola SDK 3.2.0 or higher.

Method 1 (via the UI):

In Xcode:

  1. Open Info.plist from the project navigator.
  2. Next to the top-level key, click on Add (+):
    1. Enter SKAdNetworkItems as the new key's name.
    2. Select Array as the type.
  3. Expand the newly created Array key (using the arrow).
  4. Click on Add (+) and select Dictionary as the new key's type.

To add the Taboola Network ID:

  1. Expand the newly created Dictionary key (using the arrow).
  2. Click on Add (+):
    1. Enter SKAdNetworkIdentifier as the new key's name.
    2. Leave the type as String.
    3. Enter p4ybsjem3u.skadnetwork as the value.

Your newly created entries should like this:

πŸ“˜

To add more Ad Networks, repeat the previous step:

  • Enter SKAdNetworkIdentifier as the name of each new key.
  • Enter the Ad Network's unique ID as the value of the key.

Method 2 (via XML):

Edit Info.plist in a text editor and add this code snippet:

<key>SKAdNetworkItems</key>
    <array>
        <dict>
            <key>SKAdNetworkIdentifier</key>
            <string>p4ybsjem3u.skadnetwork</string>
        </dict>
    </array>

Troubleshooting

iPhone simulator with M1/M1X machine

Problem

In some cases, when running the iPhone simulator with an M1/M1X machine, Xcode throws the following error:

building for iOS Simulator, but linking in dylib built for iOS, file '../TaboolaSDK.framework/TaboolaSDK' for architecture arm64

πŸ“˜

This issue affects the simulator only - not real devices.

Resolution

To work around this problem, add arm64 to the excluded architectures for that project.

Using Xcode:

  1. Select the project within the project navigator (top, left).
  2. Select the Build Settings tab (right). Make sure that the All tab (just below) is also selected.
  3. Under Architectures, locate the Excluded Architectures node.
  4. Next to the Debug or Release node, click on the + icon to add a new exclusion:
    • For the key, select Any iOS Simulator SDK.
    • For the value, type in arm64.

πŸ“˜

Depending on your needs, add an exclusion under Debug or Release - or both.


πŸ’

🏻 Need a hand?

Go ahead! Ask a question in our Support Forum.

Tip: Provide as much detail as possible, including your platform and SDK version.

Next steps

Basic Integration

Updated 5 days ago


First Steps


iOS Classic - First Steps

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.