SDK DocumentationRecipesAnnouncementsSupport Forum
AndroidiOSAnnouncementsSupport Forum

Migrating from SDK 2 to SDK 3

πŸ“˜

This guide explains how to upgrade the following integrations:

  • Taboola SDK
  • Taboola React Native plugin

This guide does not cover how to upgrade a Taboola Flutter plugin integration.

Introduction

In order to streamline the integration, most of the methods and events from SDK 2 and React Native 2.x have been updated or replaced, as well as the integration methodology. As such, when migrating from SDK 2 to SDK 3 (including React Native 2.x to 3.x) treat it as a new integration.

Placement codes used for SDK 2 can be used with SDK 3 and no new codes are required for the upgrade.

Additional migration guidelines for Android and iOS SDKs are provided below:

Migration Guidelines for Android SDK 2.x -> 3.x

🚧

Treat SDK 3 as a new integration.
It is not sufficient to update the .gradle file only.

  1. Update build.gradle to use the latest SDK 3 version (<<androidSDKVersion>>).

    For detailed instructions, see:

  2. From within Android Studio, select: File > Sync Project With Gradle Files.

  3. Remove (or comment) out all Taboola SDK 2 code: init methods, setters, listeners, XML files, etc.

  4. From within Android Studio, select: Build > Clean Project.

  5. Build the project and verify it compiles correctly, with the newly removed SDK 2 code.

    Compilation errors?

    From within Android Studio, select: File > Invalidate Caches/Restart

  6. Implement the SDK 3 integration - see:

Migration Guidelines for iOS SDK 2.x -> 3.x

🚧

Treat SDK 3 as a new integration.
It is not sufficient to update the pod file only.

  1. Edit your pod file to use the latest SDK 3 version (<<iosSDKVersion>>).

    For detailed instructions, see:

  2. Run pod install.

  3. Remove (or comment) out all Taboola SDK 2 code: init methods, setters, delegates, Storyboard elements, etc.

  4. From within Xcode, select: Product > Clean Build Folder.

  5. Build the project and verify it compiles correctly (with the removed SDK 2 code).

    Compilation errors?

    In the project root directory:

    • Run rm -rf Pods to remove all pod files.
    • Run pod install to install the SDK 3 pods.
  6. Implement the SDK 3 integration - see:

Migration Guidelines for React-Native plugin 2.x to 3.x

🚧

Treat React-Native 3.x as a new integration.

Make sure to comment out or delete old code related to React-Native 2.x and then proceed with the integration guide for 3.x