Companion

object Companion

Gets on private val are critical as they deffer resolution

Properties

Link copied to clipboard
Link copied to clipboard
var currentEnvironment: StorytellerEnvironment

Gets the current API environment the SDK is configured to use. This is typically set internally during initialization or can be overridden for testing purposes.

Link copied to clipboard

Enables or disables verbose logging from the Storyteller SDK. Default is false. See also Additional SDK Methods.

Link copied to clipboard

Gets the current event tracking options. These options are set during SDK initialization and cannot be modified afterwards. For details on privacy and tracking options, see the Storyteller Privacy and Tracking Documentation.

Link copied to clipboard

Indicates whether the Storyteller SDK has been successfully initialized. This becomes true after a successful call to initialize.

Link copied to clipboard

Indicates whether the Storyteller player UI is currently visible on screen. This is managed internally by the SDK.

Link copied to clipboard

Indicates whether the search functionality is enabled for the current API key. This is determined by the settings fetched from the Storyteller backend.

Link copied to clipboard
var modules: List<StorytellerModule>

A list of StorytellerModule instances for integrating with ad providers like GAM. This list should be set before initializing the Storyteller SDK.

Link copied to clipboard

A delegate for handling various events and actions within the Storyteller SDK. This allows the client application to customize behavior or react to SDK events. See StorytellerDelegate for the available callback methods.

Link copied to clipboard
var theme: UiTheme?

The global UI theme for the Storyteller SDK. This theme will be applied to all Storyteller views unless overridden at a more specific level. Use UiThemeBuilder to create and customize themes.

Link copied to clipboard
var useCustomScreenForCategory: (StorytellerCategory) -> Boolean

A lambda function that allows overriding the default behavior for opening a category. If this lambda returns true for a given StorytellerCategory, the SDK will not handle the category opening, allowing the client application to implement custom navigation or UI for specific categories. Default implementation always returns false.

Link copied to clipboard

Provides access to user attributes stored by the SDK.

Link copied to clipboard
val version: <Error class: unknown class>

Gets the current version name of the Storyteller SDK.

Functions

Link copied to clipboard
fun dismissPlayer(animated: Boolean = true, reason: String? = null, onCompletion: () -> Unit = {})

Dismisses the currently visible Storyteller player. For more information on this and other utility methods, see Additional SDK Methods.

Link copied to clipboard
suspend fun getClipsCount(categoryIds: List<String>): Int

Retrieves the count of clips for the specified categories.

Link copied to clipboard
suspend fun getStoriesCount(categoryIds: List<String>): Int

Retrieves the count of stories for the specified categories.

Link copied to clipboard
fun initialize(apiKey: String, userInput: StorytellerUserInput? = null, eventTrackingOptions: Storyteller.StorytellerEventTrackingOptions = StorytellerEventTrackingOptions(), onSuccess: () -> Unit = {}, onFailure: (StorytellerError) -> Unit = {})

Initializes the Storyteller SDK with the provided API key and optional user input. This method should be called once, typically in your Application's onCreate method. Initialization is asynchronous. The onSuccess callback is invoked upon successful initialization, and onFailure is invoked if an error occurs. For details on providing user information, see the Storyteller User Management Documentation. For a general guide on SDK setup, refer to the Getting Started Guide.

Link copied to clipboard

Checks if the given string is a valid Storyteller deep link. This includes deep links for Stories, Clips collections, categories, or sheets. For more information on deep linking, see the Storyteller Deep Linking Documentation.

Link copied to clipboard
fun openCategory(activity: Activity, category: String, storyId: String? = null, openedReason: Storyteller.StorytellerStoriesOpenReason = StorytellerStoriesOpenReason.INSTANCE_METHOD, onError: (StorytellerError) -> Unit = {})

Opens a specific category of Stories. Optionally, a specific Story within that category can be targeted.

Link copied to clipboard
fun openCollection(activity: Activity, configuration: Storyteller.StorytellerClipCollectionConfiguration, openReason: Storyteller.StorytellerClipsOpenReason = StorytellerClipsOpenReason.DEEPLINK, titleDrawable: Drawable? = null, onError: (StorytellerError) -> Unit = {})

Opens a collection of Clips using a StorytellerClipCollectionConfiguration. This allows specifying the collection ID, an optional category ID, and an optional starting Clip ID.

Link copied to clipboard
fun openCollectionByExternalId(activity: Activity, collectionId: String, externalId: String? = null, titleDrawable: Drawable? = null, onError: (StorytellerError) -> Unit = {})

Opens a collection of Clips by its ID, optionally starting with a Clip identified by its external ID. For more details on opening the Storyteller player, see the Opening the Player Documentation.

Link copied to clipboard
fun openDeepLink(activity: Activity, storytellerDeepLink: String, onError: (StorytellerError) -> Unit = { })

Opens content based on a Storyteller deep link. This method can handle deep links for Stories, Clips collections, categories, or sheets. For more information on deep linking, see the Storyteller Deep Linking Documentation.

Link copied to clipboard
fun openPage(activity: Activity, pageId: String? = null, openedReason: Storyteller.StorytellerStoriesOpenReason = StorytellerStoriesOpenReason.INSTANCE_METHOD, onError: (StorytellerError) -> Unit = {})

Opens a specific Page within a Story by its ID.

Link copied to clipboard
fun openSearch(activity: Activity)

Opens the Storyteller search interface. This method will only work if search is enabled for your API key. Check isSearchEnabled.

Link copied to clipboard
fun openSheet(activity: AppCompatActivity, sheetId: String, onError: (StorytellerError) -> Unit)

Opens a Storyteller Sheet (a bottom sheet UI component) by its ID. For more information on this and other utility methods, see Additional SDK Methods.

Link copied to clipboard
fun openStory(activity: Activity, storyId: String? = null, openedReason: Storyteller.StorytellerStoriesOpenReason = StorytellerStoriesOpenReason.INSTANCE_METHOD, onError: (StorytellerError) -> Unit = {})

Opens a specific Story by its ID.

Link copied to clipboard
fun openStoryByExternalId(context: Activity, externalId: String? = null, openedReason: Storyteller.StorytellerStoriesOpenReason = StorytellerStoriesOpenReason.INSTANCE_METHOD, onError: (StorytellerError) -> Unit = {})

Opens a Story by its external ID. External IDs are alternative identifiers that can be assigned to Stories in the Storyteller CMS.

Link copied to clipboard
fun preloadClips(collection: String, clipsIds: List<String> = emptyList(), preloadVideos: Boolean = false): StorytellerClipPreloadHandle?

Preloads a Clips collection and optional single Clip IDs into the in-memory cache.

Link copied to clipboard

Resumes playback if a Storyteller player is active and paused. For more information on this and other utility methods, see Additional SDK Methods.