SDK DocumentationRecipesAnnouncementsSupport Forum
AndroidiOSAnnouncementsSupport Forum
SDK Documentation

Migrating from Flutter plugin 0.x

Overview

A number of objects and methods have changed in version 1.x of the Taboola Flutter plugin.

When migrating your app from version 0.x, refer to the checklist below.

📘

Guidelines

  1. Update import statements to use the new package names.
  2. Rename relevant objects.
  3. Rename callback methods.
  4. Rename the getTaboolaClassicBuilder() method.
  5. Ensure that you invoke init() with a single param.
  6. To pass extraProperties, invoke a setter at the appropriate level: Taboola, TBLClassicPage or TBLClassicUnit.

Checklist

v0.xv1.x
// Packages to import:

'taboola_sdk/taboola.dart';
'taboola_sdk/classic/classic.dart';
'taboola_sdk/classic/classic_listener.dart';
// Packages to import:

'taboola_sdk/taboola.dart';
'taboola_sdk/classic/tbl_classic.dart';
'taboola_sdk/classic/tbl_classic_page.dart';
'taboola_sdk/classic/tbl_classic_listener.dart';
PublisherInfoTBLPublisherInfo
TaboolaClassicListenerTBLClassicListener
// Callback method:
taboolaDidResize()
// Callback method:
onResize()
// Callback method:
taboolaDidShow()
// Callback method:
onAdReceiveSuccess()
// Callback method:
taboolaDidFailToLoad()
// Callback method:
onAdReceiveFail()
// Callback method:
taboolaDidClickOnItem()
// Callback method:
onItemClick()
// Old signature (WITH optional extraProperties param):

Taboola.init(PublisherInfo(publisher), extraProperties: extraProperties);
// New signature:

Taboola.init(TBLPublisherInfo(publisher));
// (See above)// Global setter for extra properties:

Taboola.setGlobalExtraProperties(HashMap<String, dynamic> extraProperties)
// (See above)// Page-level setter for extra properties:

TBLClassicPage.setPageExtraProperties(HashMap<String, dynamic> extraProperties)
// (See above)// Unit-level setter for extra properties:

TBLClassicUnit.setUnitExtraProps(HashMap<String, dynamic> extraProperties)
TaboolaClassicBuilderTBLClassicPage
getTaboolaClassicBuilder() // method getClassicPage() // method
TaboolaClassicUnitTBLClassicUnit