Richie
@MainActor
public final class Richie
Richie
is the main entry point to the Richie SDK.
Use Richie
to construct the top-level SDK objects for ads, books and editions. You can use the
shared
property if you prefer a singleton, or just pass around an instance. Richie
stores
the objects you create, so that the first call to makeX
creates the X
, and subsequent calls
return the same object.
Warning
Do not construct multiple Richie
instances at the same time. They use the same
resources on disk and will interfere with each other.
-
Initialize the
shared
singleton instance.Call this method before accessing the shared instance.
Important
This method must not be called multiple times.
Declaration
Swift
public static func initializeShared( appIdentifier: String )
-
Access a singleton instance.
Important
You must call
initializeShared(appIdentifier:)
before accessing this property.Declaration
Swift
public static var shared: Richie { get }
-
Initialize
Richie
with application identifier.Declaration
Swift
public init( appIdentifier: String )
-
makeAds()
AsynchronousMake a
RichieAdsController
instance or return a previously constructed one.Declaration
Swift
public func makeAds() async throws -> RichieAdsController
-
Make an
Editions
instance or return a previously constructed one.Declaration
Swift
public func makeEditions( analyticsListener: (any AnalyticsListener)?, editionsConfiguration: EditionsConfiguration = .init(maxZoomFactor: 1.0), tokenProvider: any TokenProvider ) async throws -> Editions
-
makeBooks(analyticsListener:
AsynchronousarticleOpener: audioPlaybackController: bookCoverOverlayProvider: bookOpening: booksLibraryNavigationDelegate: displayConfigProvider: editionsConfiguration: enabledTabs: htmlToAttributedStringConverter: miniplayerProvider: readingListHost: stringProvider: tokenProvider: topBarProvider: ) Make a
BooksLibraryController
instance or return a previously constructed one.Declaration
Swift
func makeBooks( analyticsListener: (any AnalyticsListener)? = nil, articleOpener: ArticleOpener?, audioPlaybackController: AudioPlaybackController? = nil, bookCoverOverlayProvider: BookCoverOverlayProvider?, bookOpening: BookOpening, booksLibraryNavigationDelegate: BooksLibraryNavigationDelegate?, displayConfigProvider: BooksDisplayConfigProvider, editionsConfiguration: EditionsConfiguration = .init(maxZoomFactor: 1.0), enabledTabs: [LibraryTab], htmlToAttributedStringConverter: BooksHTMLToAttributedStringConverter? = nil, miniplayerProvider: MiniplayerProvider? = nil, readingListHost: ReadingListHost?, stringProvider: UserVisibleStringProvider?, tokenProvider: TokenProvider, topBarProvider: TopBarProvider? = nil ) async throws -> BooksLibraryController