Additional Methods

Additional helper methods and properties.

Setting global StorytellerDelegate

Please see the dedicated StorytellerDelegate.

    Storyteller.storytellerDelegate = myCustomStorytellerDelegate

Dismissing a story player

dismissStoryView(Boolean, String?) force closes the currently open story views. If no story view is open when this is called, it has no effect.

Parameters -animated: the flag indicating if close animation should be triggered. Defaults to true. -reason: the reason why the story pager was force closed. This will be used to populate the dismissedReason parameter of the corresponding onUserActivityOccurred callback. If this is set to null the onUserActivityOccurred callback will not be triggered

Storyteller.dismissStoryView(true, "reason")

Checking if Storyteller is initialized

isInitialized boolean static property which is set to true if Storyteller was initialized successfully.

val initialized = Storyteller.isInitialized

Storyteller version

version static String property which holds the SDK version.

val storytellerVersion = Storyteller.version

Checking if a deep link should be handled by the Storyteller SDK

isStorytellerDeepLink(String) check if the string is a valid Storyteller deep link.

Storyteller.isStorytellerDeepLink("stories://open/9329bed2-2311-69b8-cbcf-39fcf8d8af21/f6445df7-bd79-71de-cdfb-39fd071568a1")

openStory

The openStory() method opens a specific story by its id parameter, a UUID identifier returned from the API. If id is an empty string, invalid, or not specified the onFailure callback will be called so your app can handle this error. The story is opened in the single story mode.

Parameters:

  • activity: activity
  • storyId: unique story id
  • onError: callback for an error

Example:

    Storyteller.openStory(
      activity = activity,
      storyId = id
    ){ error -> //action to do on error
    }

openPage

The openPage() method opens a specific page by its id parameter, a UUID identifier returned from the API. If id is an empty string, invalid, or not specified the onFailure callback will be called so your app can handle this error. The story is opened in the single story mode.

Parameters:

  • activity: activity
  • pageId: unique page id
  • onError: callback for an error

Example:

    Storyteller.openPage(
      activity = activity,
      pageId = id
    ){ error -> //action to do on error
    }

The openDeepLink() method opens a specific story or page. If the link is an empty string, or invalid the onFailure callback will be called so your app can handle this error. The story is opened in the single story mode.

Parameters:

  • activity: activity
  • storytellerDeepLink: valid Storyteller deep link
  • onError: callback for an error

Example:

    Storyteller.openDeepLink(activity, storytellerDeepLink) { error ->
        //action to do on error
    }
PREVIOUS
Forward Arrow