Listener
The Join Stories SDK uses Swift Result
types for handling error with asynchronous methods startThumbView and startPlayer.
StoriesCallback
: when calling startThumbView
public typealias StoriesCallback = (Result<[StoryValue], StoriesAPIError>) -> Void
StoriesCompletionHandler
: when calling startPlayer
public typealias StoriesCompletionHandler = (Result<Void, StoriesAPIError>) -> Void
Errors are enumerated under StoriesAPIError
enum:
public enum StoriesAPIError: Error {
/// Bad or missing configuration (if setConfiguration is not called)
case badConfiguration(JoinConfigurationError)
/// timeOutInterval parameter from StoryViewConfig has been reached
case fetchingStoriesTimedOut
/// Error on fetching stories request
case fetchingStoriesFailed
/// Fetch query returns successfully, but contains no story
case fetchingStoriesEmpty
}