Skip to main content

Migrations

From 0.10.x to 0.11.0​

Domain models replacing generated DTOs​

In 0.11.0, generated pigeon DTO classes are no longer exported directly. Clean, immutable domain models are now exposed throughout the SDK public API and callback signatures:

Old DTO class (0.10.0)New Domain model (0.11.0)
StoryDataDtoStoryData
SlideDataDtoSlideData
InAppMessageDataDtoInAppMessageData
GoodsItemDataDtoGoodsItemData
ContentDataDtoContentData
StoryTypeDtoStoryType
SourceTypeDtoSourceType
ClickActionDtoClickAction
InAppMessageTypeDtoInAppMessageType
ContentTypeDtoContentType

IASCallbacks mixin​

Update callback signatures to use StoryData and SlideData:

class _FeedWidgetState extends State<FeedWidget> with IASCallbacks {

void onShowStory(StoryDataDto? storyData) {}
void onShowStory(StoryData? storyData) {}


void onCloseStory(SlideDataDto? slideData) {}
void onCloseStory(SlideData? slideData) {}


void onFavoriteTap(SlideDataDto? slideData, bool isFavorite) {}
void onFavoriteTap(SlideData? slideData, bool isFavorite) {}
}

IASInAppMessageCallback mixin​

Update callback signatures to use InAppMessageData:

class _IAMState extends State<IAMWidget> with IASInAppMessageCallback {

void onShowInAppMessage(InAppMessageDataDto? inAppMessageData) {}
void onShowInAppMessage(InAppMessageData? inAppMessageData) {}


void onCloseInAppMessage(InAppMessageDataDto? inAppMessageData) {}
void onCloseInAppMessage(InAppMessageData? inAppMessageData) {}


void onInAppMessageWidgetEvent(InAppMessageDataDto? inAppMessageData, String? name, Map<String?, Object?>? data) {}
void onInAppMessageWidgetEvent(InAppMessageData? inAppMessageData, String? name, Map<String?, Object?>? data) {}
}

IASGameReaderCallback mixin​

Update callback signatures to use ContentData:

class _GameState extends State<GameWidget> with IASGameReaderCallback {

void startGame(ContentDataDto? gameData) {}
void startGame(ContentData? gameData) {}


void closeGame(ContentDataDto? gameData) {}
void closeGame(ContentData? gameData) {}
}

IASCallToActionCallback mixin​

Update callback signatures to use SlideData and ClickAction:

class _FeedState extends State<FeedWidget> with IASCallToActionCallback {

void callToAction(SlideDataDto? slideData, String? url, ClickActionDto? clickAction) {}
void callToAction(SlideData? slideData, String? url, ClickAction? clickAction) {}
}

Goods: GoodsItemData and goodsItemSelected​

In 0.11.0, IASGoodItemSelectedCallback receives GoodsItemData instead of GoodsItemDataDto. Note that GoodsItemData exposes the product description via the .description property:

class _ExampleState extends State<Example> with IASGoodItemSelectedCallback {

Future<void> goodsItemSelected(GoodsItemDataDto item) async {
Future<void> goodsItemSelected(GoodsItemData item) async {
final desc = item.productDescription;
final desc = item.description;
}
}

Similarly, InAppStoryManager.instance.setGetSkusCallback now expects Future<List<GoodsItemData>>:

InAppStoryManager.instance.setGetSkusCallback((List<String> skus) async {
final listOfGoods = <GoodsItemDataDto>[];
final listOfGoods = <GoodsItemData>[];
// ...
return listOfGoods;
});

Game controls: IASGamesHostApi migration​

IASGamesHostApi is no longer exported. All game operations are now available through InAppStoryManager.instance:

await IASGamesHostApi().openGame(gameId);
await InAppStoryManager.instance.openGame(gameId);

await IASGamesHostApi().closeGame();
await InAppStoryManager.instance.closeGame();

await IASGamesHostApi().preloadGames();
await InAppStoryManager.instance.preloadGames();

Banners: BannerDecoration deprecation & global placeholder​

BannerDecoration and the bannerDecoration parameter of BannerPlace are deprecated and ignored. Banner loading placeholders are now configured globally once across all banner places via AppearanceManager.instance.setBannersPlaceholder:

BannerPlace(
placeId: 'placeId',
height: 120,
bannerDecoration: BannerDecoration(
color: Colors.indigo,
image: 'assets/icons/loader.png',
),
);

Targeting for Single Story and In-App Messages​

In 0.11.0, new methods are available to show single stories or in-app messages with targeting evaluation and optional request-specific tags:

  • Use InAppStoryManager.instance.showStoryWithTargeting(storyId, tags: ...) when you want targeting rules checked.
  • Use InAppStoryManager.instance.showIAMByIdWithTargeting(id, tags: ...) to show an in-app message with targeting evaluation.
  • Use InAppStoryManager.instance.showIAMByEventWithTargeting(event, tags: ...) to pass request-specific tags to event-based messages.

From 0.9.x to 0.10.0​

Checkout: ProductCartOffer​

In 0.10.0, the description field in ProductCartOffer was renamed to offerDescription:

final desc = offer.description;
final desc = offer.offerDescription;
ProductCartOffer(
offerId: 'id',
name: 'Product Name',
description: 'Product description',
offerDescription: 'Product description',
availability: 1,
quantity: 1,
imageUrls: [],
);

Goods: GoodsItemDataDto​

In GoodsItemDataDto (received in the goodsItemSelected callback of IASGoodItemSelectedCallback), the description field was renamed to productDescription:


Future<void> goodsItemSelected(GoodsItemDataDto item) async {
final desc = item.description;
final desc = item.productDescription;
}

From 0.7.x to 0.8.0​

Single stories, IAM and Onboardings​

In 0.8.0 version added cancellation of long-running operations for single stories, IAM and onboardings. Instead of xxxHostApi().methodName() use InAppStoryManager.instance.methodName().

  • Single stories
IASSingleStoryHostApi().show(storyId: story.id);
InAppStoryManager.instance.showStory(story.id);

IASSingleStoryHostApi().showOnce(storyId: story.id);
InAppStoryManager.instance.showStoryOnce(story.id);
  • In-App Messages
IASInAppMessagesHostApi().showById(messageId);
InAppStoryManager.instance.showIAMById(messageId);

IASInAppMessagesHostApi().showByEvent(event);
InAppStoryManager.instance.showIAMByEvent(event);

IASInAppMessagesHostApi().preloadMessages();
InAppStoryManager.instance.preloadInAppMessages();
  • Onboardings
IASOnboardingsHostApi().show(limit: 10);
InAppStoryManager.instance.showOnboardings(10);

Story and onboardings callbacks​

Also, in this release IShowStoryCallbackFlutterApi and IASOnboardingLoadCallback have been replaced to IASShowStoryCallback and IASOnboardingLoadCallback mixin.

From 0.7.2-0.7.5 to 0.7.6​

BannerPlace callbacks​

In version 0.7.6, the IASbannerPlaceCallback mixin was removed from the SDK. All widget events can be listened with callbacks in the BannerPlace widget. Check out new implementation.

class BannersPage extends StatefulWidget {
const BannersPage({super.key});


State<BannersPage> createState() => _BannersPageState();
}

class _BannersPageState extends State<BannersPage> {
final _placeId = "placeId";


Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: Column(
children: [
BannerPlace(
placeId: _placeId,
height: 120,
onBannerScroll: (index) {
// Do anything related
},
),
],
),
);
}
}

From 0.7.0 to 0.7.1​

In the 0.7.1 release of the library Android SDK initialization part has changed. Instead of extending MainActivity from FlutterFragmentActivity you need to extend it from InAppStoryActivity:

package com.example.yourapp;

import com.inappstory.inappstory_plugin.activity.InAppStoryActivity

class MainActivity : InAppStoryActivity();

From 0.6.1 to 0.7.0​

Gamer reader callbacks​

In the 0.7.0release the GameReaderCallbackFlutterApi was changed to IASGameReaderCallback mixin. To use IASGameReaderCallback correctly, follow the documentation.

IASBannerPlaceCallback mixin was updated and now supports placing multiple banner places on one screen. Please update integration with new instructions.

From 0.3.4–0.3.6 to 0.4.0​

AppearanceManager​

In version 0.4.0 AppearanceManagerHostApi class is a singleton. To access AppearanceManager you need to call AppearanceManager.instance instance of class.

Below is an example of enabling like functionality:

// old
Future<void> changeHasLikeOld(bool enabled) async {
await AppearanceManagerHostApi().setHasLike(enabled);
}

// new
Future<void> changeHasLike(bool enabled) async {
await AppearanceManager.instance.setHasLike(enabled);
}

CallToAction​

CallToActionCallbackFlutterApi callback is now a mixin class - IASCallToActionCallback. You can find the new class implementation here.

From 0.3.3 to 0.3.4​

InAppStoryManager​

InAppStoryManager class is now a singleton. To access InAppStoryManager you need to call InAppStoryManager.instance instance of class.

Below is an example of changing the user:

// old
Future<void> changeUserOld(String newUserId) async {
await InAppStoryManagerHostApi().changeUser(newUserId);
}

// new
Future<void> changeUser(String newUserId) async {
await InAppStoryManager.instance.changeUser(newUserId);
}

From 0.2.x to 0.3.x​

warning

Deprecated​

In this version, a new FeedStoriesWidget widget replaced InAppStoryPlugin().getStoriesWidgets() method that allows you to customize the appearance of the story content.
For more information read here;

Methods InAppStoryPlugin().getStoriesWidgets() and InAppStoryPlugin().getFavoritesStoriesWidgets() are now deprecated and will be removed in future releases.

Android initialization​

By default, Android MainActivity class is extended by FlutterActivity. To use In-App-Messaging feature, you need to extend MainActivity class from FlutterFragmentActivity. Below you can find an example of implementation:

package com.example.app

import io.flutter.embedding.android.FlutterFragmentActivity

class MainActivity : FlutterFragmentActivity()