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.
Every Richie instance in a process shares the same objects. Constructing one with a different
identifier than the first is a programming error.
-
Initialize the
sharedsingleton instance.Call this method before accessing the shared instance.
Calling this method again with the same identifier logs a warning and has no effect. Calling it with a different identifier is a programming error.
Declaration
Swift
@MainActor public static func initializeShared( richieAppID: String )Parameters
richieAppIDAn identifier for finding the configuration for the SDK. This can be the bundle ID, Richie app ID, or anything else agreed to with Richie, as long as it can be used to successfully to find a configuration in the Richie configuration service.
-
Undocumented
Declaration
Swift
@MainActor public static func initializeShared( appIdentifier: String ) -
Access a singleton instance.
Important
You must call
initializeShared(appIdentifier:)before accessing this property.Declaration
Swift
@MainActor public static var shared: Richie { get } -
Initialize
Richiewith application identifier.All instances in a process share the same SDK objects.
Declaration
Swift
@available(*, deprecated, message: "Use Richie.initializeShared(richieAppID:﹚ and Richie.shared.") @MainActor public convenience init( richieAppID: String )Parameters
richieAppIDThe identifier that should be used to find configuration for the app. This can be the bundle ID, Richie app ID, or anything else agreed to with Richie, as long as it can be used to successfully to find a configuration in the Richie configuration service.
-
Undocumented
Declaration
Swift
@MainActor public convenience init( appIdentifier: String ) -
makeAds()AsynchronousMake a
RichieAdsControllerinstance or return a previously constructed one.Declaration
Swift
@MainActor public func makeAds() async throws -> RichieAdsController -
makeEditions(analyticsListener:AsynchronoustokenProvider: ) Make an
Editionsinstance or return a previously constructed one.Declaration
Swift
@MainActor public func makeEditions( analyticsListener: (any AnalyticsListener)?, tokenProvider: any TokenProvider ) async throws -> Editions -
Update privacy policy consent keys.
Declaration
Swift
@MainActor public func setConsent(keys: [String]) -
makeBooks(analyticsListener:AsynchronousarticleOpener: loginPresenter: audioPlaybackController: backgroundTaskSource: bookCoverOverlayProvider: bookOpening: booksFeedSortingType: booksLibraryAnalyticsLoggerCallback: booksLibraryHostAppConfigDataCallback: booksLibraryNavigationDelegate: categoriesCompositionEnabled: categoryListIconProvider: displayConfigProvider: enabledTabs: htmlToAttributedStringConverter: libraryRootDirectory: locale: miniplayerProvider: myBooksFilterItems: readingListHost: searchResultsProviderType: settingsViewControllerProvider: shouldImportLocalBooksToReadingList: stringProvider: tabBarStyle: tokenProvider: topBarProvider: uiReadyCallback: window: windowScene: isAlwaysInterestedInBooksContent: ) Make a
BooksLibraryControllerinstance or return a previously constructed one.Declaration
Swift
@MainActor func makeBooks( analyticsListener: (any AnalyticsListener)? = nil, articleOpener: ArticleOpener?, loginPresenter: BooksLoginPresenter? = nil, audioPlaybackController: AudioPlaybackController? = nil, backgroundTaskSource: RichieBackgroundTaskSource? = nil, bookCoverOverlayProvider: BookCoverOverlayProvider?, bookOpening: BookOpening, booksFeedSortingType: BooksFeedSortingType = .alphabetically, booksLibraryAnalyticsLoggerCallback: BooksLibraryController.BooksLibraryAnalyticsLoggerCallback? = nil, booksLibraryHostAppConfigDataCallback: ((Data) -> Void)? = nil, booksLibraryNavigationDelegate: BooksLibraryNavigationDelegate?, categoriesCompositionEnabled: Bool = true, categoryListIconProvider: CategoryListIconProvider? = nil, displayConfigProvider: BooksDisplayConfigProvider, enabledTabs: [LibraryTab], htmlToAttributedStringConverter: BooksHTMLToAttributedStringConverter? = nil, libraryRootDirectory: String? = nil, locale: Locale = Locale.autoupdatingCurrent, miniplayerProvider: MiniplayerProvider? = nil, myBooksFilterItems: [BooksFilterItem]? = nil, readingListHost: ReadingListHost?, searchResultsProviderType: SearchResultsProviderType = .regular, settingsViewControllerProvider: ViewControllerProvider? = nil, shouldImportLocalBooksToReadingList: Bool = false, stringProvider: UserVisibleStringProvider?, tabBarStyle: BooksLibraryTabBarStyle = .custom, tokenProvider: TokenProvider, topBarProvider: TopBarProvider? = nil, uiReadyCallback: (() -> Void)? = nil, window: UIWindow? = nil, windowScene: UIWindowScene? = nil, isAlwaysInterestedInBooksContent: Bool = false ) async throws -> BooksLibraryController