Skip to main content
Version: 3.x.x

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:

CaseContent
.storyA classic multi-page story
.shortsShort-form vertical video
.snapSnap content
.adAn advertisement experience
.unknownA 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, and handle identify the experience.
  • type gives its StorifyMeExperienceType.
  • widgetId identifies the widget that returned it.
  • tags contains its configured tags.
  • thumbnailUrl returns the best available preview image URL.
  • navigationUrl contains an optional configured deep link or web URL.
  • totalDuration may contain the total playback duration.
  • isSeen reports 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.