getAd

abstract fun getAd(adRequestInfo: StorytellerAdRequestInfo, onComplete: (StorytellerAd) -> Unit = {}, onError: () -> Unit)

This method does not need to be implemented unless there is specific use case. For Ads Support use Storyteller Gam Module.

Called when the SDK requires ad data from the containing app. This method is invoked if the ad configuration in the Storyteller CMS is set to request ads from the "Integrating App". The implementation should fetch the ad data (asynchronously if necessary) and provide it via the onComplete callback. For more information on ad integration, see the Storyteller Ads Documentation.

Parameters

adRequestInfo

A StorytellerAdRequestInfo object containing details about the ad slot and targeting.

onComplete

A callback function to provide the fetched StorytellerAd data to the SDK, must be called upon successful ad retrieval.

onError

A callback function to notify the SDK if an error occurred while fetching the ad, must be called if ad retrieval fails.