Experiences
StorifyMe iOS SDK 3.x represents each piece of content as a StorifyMeExperience. The model covers stories, shorts, snaps, and ads. Use its type to branch on the content kind, and prefer the experience terminology in new code.
Content types
StorifyMeExperienceType has five cases:
| Case | Content |
|---|---|
.story | A classic multi-page story |
.shorts | Short-form vertical video |
.snap | Snap content |
.ad | An advertisement experience |
.unknown | A type added by the server that this SDK does not recognize yet |
Include .unknown or a default branch so your app can handle content added in later SDK or server versions.
func handle(_ experience: StorifyMeExperience) {
switch experience.type {
case .story:
showStoryAnalytics(experience)
case .shorts:
showShortsAnalytics(experience)
case .snap:
showSnapAnalytics(experience)
case .ad:
showAdAnalytics(experience)
case .unknown:
break
}
}
Model fields
The main public fields are:
id,name, andhandleidentify the experience.typegives itsStorifyMeExperienceType.widgetIdidentifies the widget that returned it.tagscontains its configured tags.thumbnailUrlreturns the best available preview image URL.navigationUrlcontains an optional configured deep link or web URL.totalDurationmay contain the total playback duration.isSeenreports whether the user completed the experience.
For event handling, see iOS events. For filtering a widget by experience IDs or clearing an experience's seen state, see configuration.
Ad metadata
When type == .ad, inspect adInfo to identify the ad source and, for a custom ad, access its StorifyMeAd payload. adInfo may be nil or .unknown when the source is not recognized.
func handleAd(_ experience: StorifyMeExperience) {
guard experience.type == .ad else { return }
switch experience.adInfo {
case .custom(let ad):
showCustomAdDisclosure(ad)
case .storifyme:
showStorifyMeDisclosure()
case .google:
showGoogleDisclosure()
case .unknown, nil:
break
@unknown default:
break
}
}
The v2 StorifyMeExperienceType.customAd case was removed in v3. Handle those experiences through .ad and inspect adInfo instead.
Compatibility name
StorifyMeStoryModel remains as a deprecated typealias to StorifyMeExperience for existing integrations. New code should use StorifyMeExperience; the compatibility name is planned for removal in 4.0.0.