Additional Methods#
This page covers additional helper methods and properties.
Setting the global StorytellerDelegate#
Storyteller.sharedInstance.delegate = {
// Your delegate methods here
};
Learn more
For information on setting the global StorytellerDelegate, please refer to the dedicated StorytellerDelegate page.
Static Attributes#
isInitialized#
isInitialized is a boolean static property which is set to true if Storyteller was initialized successfully.
const initialized = Storyteller.sharedInstance.isInitialized;
isPlayerVisible#
isPlayerVisible is a boolean property set to true when a Story or Clip player is open, and false when it is dismissed.
const isStoryPlayerVisible = Storyteller.sharedInstance.isPlayerVisible;
version#
version is a static string property holding the SDK version.
const storytellerVersion = Storyteller.sharedInstance.version;
eventTrackingOptions#
Please refer to the dedicated Privacy and Tracking page.
Static Methods#
dismissPlayer#
dismissPlayer(animated: boolean): Forcefully closes the currently open Story or Player Views. If no Player is open, it has no effect.
animated: the flag indicating if close animation should be triggered.
Storyteller.sharedInstance.dismissPlayer(true);
enableLogging#
Use the enableLogging() method to turn on console logging. This can be useful for debugging and monitoring.
Storyteller.sharedInstance.enableLogging();
openStory#
await Storyteller.sharedInstance.openStory(id: string);
This method opens the Story with the specified id. The promise will reject if there was an issue opening the Story (eg if the Story couldn't be found.)
openStoryByExternalId#
await Storyteller.sharedInstance.openStoryByExternalId(externalId: string);
This method opens the Story with the specified externalId. The promise will reject if there was an issue opening the Story (eg if the Story couldn't be found.)
openPage#
await Storyteller.sharedInstance.openPage(id: string);
This method opens the Story Page with the specified id. The promise will reject if there was an issue opening the Page (eg if the Page couldn't be found.)
openCategory#
await Storyteller.sharedInstance.openCategory(categoryId: string, storyId?: string);
This method opens the Story player for the specified categoryId, at the Story specified by storyId. If storyId is unspecified, or set to an invalid value, the first Story in the category will be opened. The promise will reject if there was an issue opening the Category (eg if the Category couldn't be found.)
openCollection#
await Storyteller.sharedInstance.openCollection(collectionId: string, destination?: { categoryId?: string, clipId?: string }, openedReason?: OpenedReason.deepLink);
This method opens the Clip player for the Collection with the specified collectionId. It accepts the following parameters:
collectionId- the ID of the Collection to be opened.destination- whichcategoryIdorclipIdto show when opening the Collection. If the destination is not specified, or if the wrong value is set, we default to the first Clip in the Collection.openedReason- why the collection was opened (used for analytics). If unspecified,openedReasonwill be handled internally.
The promise will reject if there was an issue opening the Collection (eg if the Collection couldn't be found.)
openClipByExternalId#
await Storyteller.sharedInstance.openClipByExternalId(collectionId: string, externalId: string);
This method opens the Clip player for the Collection with the specified collectionId, at the Clip with the specified externalId. The promise will reject if there was an issue opening the Clip (eg if the Clip couldn't be found.)