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
- Update
import
statements to use the new package names.- Rename relevant objects.
- Rename callback methods.
- Rename the
getTaboolaClassicBuilder()
method.- Ensure that you invoke
init()
with a single param.- To pass
extraProperties
, invoke a setter at the appropriate level:Taboola
,TBLClassicPage
orTBLClassicUnit
.
Checklist
v0.x | v1.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'; |
PublisherInfo | TBLPublisherInfo |
TaboolaClassicListener | TBLClassicListener |
// 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) |
TaboolaClassicBuilder | TBLClassicPage |
getTaboolaClassicBuilder() // method | getClassicPage() // method |
TaboolaClassicUnit | TBLClassicUnit |
Updated 3 months ago