Migrating from SDK 2
Migrating from SDK 2 to SDK 4
Covered in this guide
- Migrating from Android SDK 2.x-> 4.x
For iOS and React Native plugin, refer to the SDK 3 migration guide.
Introduction
In order to streamline Taboola integration, the SDK has undergone extensive changes. As such, when migrating from v2 to v4, treat it as a new integration.
Detailed migration guidelines are provided below.
Placement codes used for v2 can be used with v4. No new codes are required.
Migrating from Android SDK 2.x -> 4.x
Treat SDK 4 as a new integration.
It is not sufficient to update the.gradle
file only.
-
Update
build.gradle
to use the latest SDK 4 version (<<androidSDKVersion>>
).For detailed instructions, see:
- Android - Classic > First Steps
- Android - Web > First Steps
-
From within Android Studio, select: File > Sync Project With Gradle Files.
-
Remove (or comment) out all Taboola SDK 2 code: init methods, setters, listeners, XML files, etc.
-
From within Android Studio, select: Build > Clean Project.
-
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
-
Implement the SDK 4 integration - see:
- Android - Classic > Basic Integration
- Android - Web > Basic Integration
SDK 3 changes
If you are migrating from SDK 2, note the following changes in SDK 3 (that also apply to SDK 4):
Key changes in SDK 3
- Widget and Feed are now instances of the same class ('Unit'), and use a similar flow.
- Widget and Feed heights are now set automatically.
- Placement View IDs are now managed automatically.
- Serial loading is now managed automatically.
- The following default values are now applied:
targetType
is"mix"
by default.- The
scrollIntercept
flag for Feed is set totrue
by default (for a seamless transition between page and Feed scrolling).
Updated 3 months ago