Experience data
Android SDK 3 represents content returned by a widget with StorifyMeExperience. The SDK creates these objects and provides them through callbacks; applications cannot construct them directly.
Public properties
| Property | Type | Description |
|---|---|---|
id | Long | Experience identifier. |
widgetId | Long | ID of the widget that returned this experience. |
type | StorifyMeExperienceType | Content kind. |
name | String? | Configured display title, if present. |
handle | String? | URL-safe experience handle, if present. |
tags | List<String> | Tags assigned to the experience. |
navigationUrl | String? | Configured web URL or app link. |
totalDuration | Double? | Total duration in seconds, when applicable. |
isSeen | Boolean | Whether the user has seen the experience. |
thumbnailUrl | String? | Best available poster URL, falling back from thumbnail to resized and original poster. |
adInfo | StorifyMeAdInfo? | Ad source and payload for ad experiences; null otherwise. |
deeplink is a deprecated alias for navigationUrl. Use navigationUrl in new code. The SDK keeps internal state such as live status and seen timestamps out of the public model.
Content types
when (experience.type) {
StorifyMeExperienceType.STORY -> showStory(experience)
StorifyMeExperienceType.SHORTS -> showShort(experience)
StorifyMeExperienceType.SNAP -> showSnap(experience)
StorifyMeExperienceType.AD -> showAd(experience)
StorifyMeExperienceType.UNKNOWN -> Unit
}
STORY: standard multi-page story.SHORTS: short-form video experience.SHORTis a deprecated alias; useSHORTS.SNAP: snap content.AD: ad experience; inspectadInfowhen you need ad-specific details.UNKNOWN: unrecognized type; keep a fallback for forward compatibility.
Example: preview and navigation
widget.widgetListener = object : StorifyMeWidgetListener {
override fun onLoaded(widgetId: Long, experiences: List<StorifyMeExperience>) {
val previews = experiences.map { experience ->
ExperiencePreview(
id = experience.id,
title = experience.name.orEmpty(),
imageUrl = experience.thumbnailUrl,
seen = experience.isSeen,
)
}
showPreviews(previews)
}
}
widget.experienceListener = object : StorifyMeExperienceListener {
override fun onNavigationRequested(
experience: StorifyMeExperience,
completion: (StorifyMeExperienceNavigationDecision) -> Unit,
) {
val url = experience.navigationUrl
if (url != null && appRouter.canHandle(url)) {
appRouter.open(url)
completion(StorifyMeExperienceNavigationDecision.HANDLE_NAVIGATION)
} else {
completion(StorifyMeExperienceNavigationDecision.OPEN_EXPERIENCE)
}
}
}
See Events for listener setup and callback behavior.