MomentsDelegate

@objc
public protocol MomentsDelegate

This delegate represents the protocol which notifies application when an event occurs in Storyly Moments.

  • This function will notify you about all Storyly Moments events and let you to send these events to specific data platforms

    Declaration

    Swift

    @objc
    optional func storylyMomentsEvent(event: StorylyMomentsEvent,
                                      storyGroup: MomentsStoryGroup?,
                                      stories: [MomentsStory]?)

    Parameters

    event

    Storyly event type which is received

    storyGroup

    Story group in which the event is received

    story

    Story in which the event is received

  • This function will notify you when user opens the media gallery to create a Moments story or when user is directed to upload screen with imported media

    Declaration

    Swift

    @available(*, deprecated, renamed: "onStoryCreatorOpen", message: "This function will be removed in v1.0.0")
    @objc
    optional func onOpenCreateStory(isDirectMediaUpload: Bool)

    Parameters

    isDirectMediaUpload

    This parameter is set to true if user directed to upload page with imported media

  • This function will notify you when user opens the media gallery to create a Moments story or when user is directed to upload screen with imported media

    Declaration

    Swift

    @objc
    optional func onStoryCreatorOpen()
  • This function will notify you when user closes the Story creator.

    Declaration

    Swift

    @objc
    optional func onStoryCreatorClose()
  • This function will notify you when user wants to preview own stories

    Declaration

    Swift

    @available(*, deprecated, renamed: "onUserStoriesOpen", message: "This function will be removed in v1.0.0")
    @objc
    optional func onOpenMyStory()
  • This function will notify you when user wants to preview own stories

    Declaration

    Swift

    @objc
    optional func onUserStoriesOpen()
  • This function will notify you when user closes the preview of own stories

    Declaration

    Swift

    @objc
    optional func onUserStoriesClose()
  • This function will notify you when user stories are loaded

    Declaration

    Swift

    @objc
    optional func onUserStoriesLoaded(storyGroup: MomentsStoryGroup?)

    Parameters

    storyGroup

    Loaded user story group information

  • This function will notify you when loading of user stories is failed

    Declaration

    Swift

    @objc
    optional func onUserStoriesLoadFailed(errorMessage: String)

    Parameters

    errorMessage

    Fail reason of loading

  • This function will notify your application in case CTA action.

    Declaration

    Swift

    @objc
    optional func onUserActionClicked(story: MomentsStory)

    Parameters

    story

    Story in which action is occurred

  • This function will notify your application in case trying to create a new Moments Component.

    Declaration

    Swift

    @objc
    optional func onPreModeration(preModerationList: [PreModeration]?, onPreModerationCompleted: (() -> Void)?)

    Parameters

    preModerationList

    list of premoderation objects of Moments Stories

    onPreModerationCompleted

    Call when premoderation is complete

  • This function will let you know that a user clicked header icon of a Storyly Moments story

    Declaration

    Swift

    @objc
    optional func storyHeaderClicked(momentsStoryGroup: MomentsStoryGroup?, story: MomentsStory?)

    Parameters

    momentsStoryGroup

    Story group in which the user clicked the icon

    story

    Story in which the user user clicked the icon

  • This function will let you know that a user clicked CTA Link preview on CTA editor. You can show your custom web view on this callback. You should set isCustomPreviewView to true in MomentsLinkCTAConfig in order to use this function

    Declaration

    Swift

    @objc
    optional func onLinkCTAPreviewURLClicked(url: String, showCustomLinkPreviewView: ((UIView) -> Void))

    Parameters

    url

    Url of the link.

    showCustomLinkPreviewDialog

    When you want to show custom LinkPreviewDialog invoke this lambda.

  • This function will let you know that a user clickedan analytic button of a Storyly Moments story. You can show your custom view on this callback for impressions and likes. You should set isCustomAnalyticsView to true in MomentsThemeConfig in order to use this function

    Declaration

    Swift

    @objc
    optional func storyAnalyticsClicked(momentsStory: MomentsStory?, stats: MomentsAnalytics?, analyticsType: AnalyticsType, showCustomAnalyticsView: ((UIView) -> Void))

    Parameters

    story

    Story in which the user user clicked the icon

    stats

    Like and impression stats of story

    showAnalyticsDialog

    When you want to show default MomentsAnalyticsDialog invoke this lambda.