StorifyMeExperience
Flutter SDK 3.0 callbacks use StorifyMeExperience, the shared model for stories, shorts, snaps, and ad experiences. It replaces the older StorifyMeStory callback model.
Properties
| Property | Description |
|---|---|
id, widgetId | Experience and widget identifiers |
type | story, shorts, snap, ad, or unknown |
name, handle, tags | Experience metadata |
navigationUrl | App link or web URL configured for the experience |
thumbnailUrl | Best available preview image URL |
totalDuration | Playback duration in seconds, when available |
isSeen | Whether the user completed the experience |
adInfo | Ad source and custom creative data for ad experiences |
deeplink remains as a deprecated alias for navigationUrl. The legacy Flutter model still has older fields; the v3 native SDKs do not expose isLive, isNew, or seenAtMillis as public experience properties.
Branch on content type
void onOpened(StorifyMeExperience? experience, int index) {
switch (experience?.type) {
case StorifyMeExperienceType.story:
analytics.track('story_opened', experience!.id);
break;
case StorifyMeExperienceType.shorts:
analytics.track('short_opened', experience!.id);
break;
case StorifyMeExperienceType.snap:
analytics.track('snap_opened', experience!.id);
break;
case StorifyMeExperienceType.ad:
analytics.track('ad_opened', experience!.id);
break;
default:
break;
}
}
StorifyMeExperienceType.short is a deprecated enum alias. Use shorts in new code.
Ad metadata
final adInfo = experience.adInfo;
if (adInfo?.source == StorifyMeAdSource.custom) {
debugPrint('Advertiser: ${adInfo?.ad?.advertiserName}');
}
StorifyMeAdInfo.source can be custom, storifyme, google, or unknown. Custom ads include a typed StorifyMeAd payload.
Open an experience from a widget
The widget state exposes v3 navigator names:
await widgetKey.currentState?.openWidgetExperienceByHandle(
'summer-campaign',
experienceBehaviour: const StorifyMeExperienceBehaviour(
playbackBehaviour: StorifyMeExperiencePlaybackBehaviour.restartExperiencesWhenOpen,
),
);
The same API is available by position and ID. openWidgetItemByPosition, openWidgetItemByHandle, and openWidgetItemById remain available for existing apps.