Additional Methods

Additional helper methods and properties.

Setting Global StorytellerDelegate

Please see the dedicated StorytellerDelegate.

    Storyteller.storytellerDelegate = myCustomStorytellerDelegate

Dismissing a Player

dismissPlayer(Boolean, String?): force closes the currently open Story or Player Views. If no Player is open when this is called, it has no effect.

animated: the flag indicating if close animation should be triggered. Defaults to true.

reason: the reason why the Story Page 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.dismissPlayer(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

Checking if story or clip player is visible

isPlayerVisible - boolean property which is set to true when a story/clip player is opened, false when the story/clip player is dismissed

val isStoryPlayerVisible = Storyteller.isPlayerVisible

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 onError 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 onError 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 onError 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
    }

enableEventTracking/disableEventTracking

The disableEventTracking() method will disable storing analytics events on Storyteller servers. By default, event tracking is enabled. Note that some events are necessary for user functionality and will still be made (but not stored) when event tracking is disabled.

Event tracking can be enabled again by calling enableEventTracking()

Example:

    Storyteller.enableEventTracking()
    Storyteller.disableEventTracking()
PREVIOUS
Forward Arrow