This is the current API key set when using initialize
.
This is the current user ID.
This is a static strong property that holds the current SDK version.
This is a boolean static property which is set to true
if Storyteller was successfully initialized.
This is a boolean property that is set to true
when a Story or Clip player is opened and false
when the Story or Clip player is dismissed.
This is the default fallback theming style used to render Story or Clips items in lists and activities launched from lists.
isStorytellerDeeplink(url: URL) -> Bool
This checks if the given URL is a Storyteller deeplink. For more information on deeplinking, see the dedicated Deeplinking page.
openStory(id: String, onError: @escaping ((Error) -> Void))
This call opens a Story with a given ID. The call will only open that individual Story.
Parameters:
id
- this is a Story's ID
onError
- this is called when there is an issue with opening a Story (e.g. the requested content is no longer available)
openPage(id: String, onError: @escaping ((Error) -> Void))
This call opens a Page with a given ID. The call will only open that individual Page.
Parameters:
id
- this is a Page's ID.
onError
- this is called when there is an issue with opening a Page (e.g. the requested content is no longer available).
openDeeplink(url: URL, onError: ((Error) -> Void)) -> Bool
This call makes Storyteller open the provided deeplink (showing the requested Page/Story). The method returns true
if the URL is a Storyteller deeplink.
Parameters:
url
- this is the Deeplink URL.
onError
- this is called when there is any issue with opening the deeplink (e.g. the requested content is no longer available).
For more information on deeplinking, see the dedicated Deeplinking page.
dismissPlayer(animated: Bool, dismissReason: String)
The dismissPlayer()
force closes the currently open Story or Clips View. If no Story or Clips View is open when this is called, it has no effect.
Parameters:
animated
- this decides whether to animate the dismissing of the view or not
dismissReason
- 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
initialize(apiKey: String, userInput: UserInput? = nil, onComplete: @escaping VoidCompletion = {}, onError: @escaping ErrorCompletion = { _ in })
The initialize
method is required to be called for Storyteller to work. It's recommended to fire this method as soon as possible in the app lifecycle.
Parameters:
This is the API key provided by the Storyteller team.
This is the ID of the user to be authorized. See Working with Users for more information on user IDs.
This is the list of categories ID to be preloaded. If array is empty the default category will be preloaded.
This is called when initialization has finished and succeeded.
This is called when there is an issue with initialization.