Skip to main content

Migrations

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(storyId);

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

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

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.

// 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,
// Add callback
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.changeUser(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()