BooksLibraryController
@MainActor
@objc
public class BooksLibraryController : NSObject
BooksLibraryController is the main entry point for the books functionality of Richie SDK.
-
Undocumented
Declaration
Swift
public typealias BooksLibraryAnalyticsLoggerCallback = (BooksLibraryAnalyticsLogger, AudioHostAppEventSink) -> Void -
init(ads:tokenProvider: bookOpening: readingListHost: bookCoverOverlayProvider: booksLibraryNavigationDelegate: articleOpener: loginPresenter: stringProvider: useCustomTabs: categoriesCompositionEnabled: additionalContentCompositions: enabledTabs: myBooksFilterItems: displayConfigProvider: editions: appID: topBarProvider: audioPlaybackController: miniplayerProvider: htmlToAttributedStringConverter: booksLibraryAnalyticsEventListener: isAlwaysInterestedInBooksContent: ) Undocumented
Declaration
Swift
@MainActor public convenience init( ads: RichieAds, tokenProvider: any TokenProvider, bookOpening: BookOpening, readingListHost: ReadingListHost?, bookCoverOverlayProvider: BookCoverOverlayProvider?, booksLibraryNavigationDelegate: BooksLibraryNavigationDelegate?, articleOpener: ArticleOpener?, loginPresenter: BooksLoginPresenter? = nil, stringProvider: UserVisibleStringProvider?, useCustomTabs: Bool, categoriesCompositionEnabled: Bool = false, additionalContentCompositions: [String]? = nil, enabledTabs: [LibraryTab], myBooksFilterItems: [BooksFilterItem]? = nil, displayConfigProvider: BooksDisplayConfigProvider, editions: EditionsBooksContext? = nil, appID: String? = nil, topBarProvider: TopBarProvider? = nil, audioPlaybackController: AudioPlaybackController? = nil, miniplayerProvider: MiniplayerProvider? = nil, htmlToAttributedStringConverter: BooksHTMLToAttributedStringConverter? = nil, booksLibraryAnalyticsEventListener: BooksLibraryAnalyticsEventListener? = nil, isAlwaysInterestedInBooksContent: Bool = false ) -
init(window:windowScene: ads: tokenProvider: bookOpening: readingListHost: backgroundTaskSource: shouldImportLocalBooksToReadingList: booksFeedSortingType: bookCoverOverlayProvider: categoryListIconProvider: booksLibraryNavigationDelegate: articleOpener: loginPresenter: stringProvider: libraryRootDirectory: applicationSupportRootDirectory: productId: tabBarStyle: additionalContentCompositions: categoriesCompositionEnabled: enabledTabs: myBooksFilterItems: searchResultsProviderType: displayConfigProvider: booksLibraryHostAppConfigDataCallback: booksLibraryAnalyticsLoggerCallback: uiReadyCallback: locale: settingsViewControllerProvider: editions: appID: topBarProvider: audioPlaybackController: miniplayerProvider: htmlToAttributedStringConverter: booksLibraryAnalyticsEventListener: isAlwaysInterestedInBooksContent: ) Undocumented
Declaration
Swift
@MainActor public init( window: UIWindow? = nil, windowScene: UIWindowScene? = nil, ads: RichieAds, tokenProvider: any TokenProvider, bookOpening: BookOpening, readingListHost: ReadingListHost?, backgroundTaskSource: RichieBackgroundTaskSource? = nil, shouldImportLocalBooksToReadingList: Bool = false, booksFeedSortingType: BooksFeedSortingType = .alphabetically, bookCoverOverlayProvider: BookCoverOverlayProvider? = nil, categoryListIconProvider: CategoryListIconProvider? = nil, booksLibraryNavigationDelegate: BooksLibraryNavigationDelegate? = nil, articleOpener: ArticleOpener?, loginPresenter: BooksLoginPresenter? = nil, stringProvider: UserVisibleStringProvider? = nil, libraryRootDirectory: String? = nil, applicationSupportRootDirectory: String? = nil, productId: String? = nil, tabBarStyle: BooksLibraryTabBarStyle = .custom, additionalContentCompositions: [String]? = nil, categoriesCompositionEnabled: Bool = true, enabledTabs: [LibraryTab] = [.discover, .myBooks, .podcasts, .catalog], myBooksFilterItems: [BooksFilterItem]? = nil, searchResultsProviderType: SearchResultsProviderType = .regular, displayConfigProvider: BooksDisplayConfigProvider, booksLibraryHostAppConfigDataCallback: ((Data) -> Void)? = nil, booksLibraryAnalyticsLoggerCallback: BooksLibraryAnalyticsLoggerCallback? = nil, uiReadyCallback: (() -> Void)? = nil, locale: Locale = Locale.autoupdatingCurrent, settingsViewControllerProvider: ViewControllerProvider? = nil, editions: EditionsBooksContext? = nil, appID: String? = nil, topBarProvider: TopBarProvider? = nil, audioPlaybackController: AudioPlaybackController? = nil, miniplayerProvider: MiniplayerProvider? = nil, htmlToAttributedStringConverter: BooksHTMLToAttributedStringConverter? = nil, booksLibraryAnalyticsEventListener: BooksLibraryAnalyticsEventListener? = nil, isAlwaysInterestedInBooksContent: Bool ) -
Undocumented
Declaration
Swift
@MainActor @objc public func start(withoutVC shouldStartWithoutVC: Bool = false) -
Undocumented
Declaration
Swift
@MainActor public func invalidate() -
Undocumented
Declaration
Swift
@MainActor public func updateBillingAnalytics(withExtraAttributes attributes: [String : Any]?) -
Undocumented
Declaration
Swift
@MainActor public func updateAnalytics(withExternalAttributes attributes: [String : Any?]) -
Reset user state (remove user specific files, close book views.)
Call this when logging out.
Declaration
Swift
@MainActor public func resetUserState() -
Reset library UI
Call this to return the library UI to its initial state.
Declaration
Swift
@MainActor public func resetLibraryUI() -
Refresh user state.
Call this when logging in.
Declaration
Swift
@MainActor public func refreshUserState() -
Get book for given id.
Declaration
Swift
@MainActor public func book(for id: String) -> Book? -
Handle a push notification that is received either when the app is running or when it is started because of it.
Declaration
Swift
@MainActor public func handlePushNotification(_ push: BooksPushNotification) -
The user-visible title of the host app’s tab that hosts this whole library, set by the host when the library is embedded in one of its tabs (the standalone
books_tabsbottom-tab host). It is reported as the composition views’BooksViewTitleanalytics attribute, since those screens otherwise know nothing about the tab the user tapped to reach them. Native books tabs built one screen at a time (createCompositionViewController(name:displayName:hostingTabTitle:)) carry their own title instead, which takes precedence.Declaration
Swift
@MainActor public var hostingTabTitle: String? { get set } -
Undocumented
Declaration
Swift
@MainActor @objc public func createViewController(enableTopBar: Bool = true) -> UIViewController -
Returns a view controller that displays a single named composition as a category-styled discover screen. The returned container shows a splash until the library has loaded its content; once ready, the composition discover screen is embedded into it. The surrounding standalone library provides the top bar and miniplayer, so the container hosts only the content.
hostingTabTitleis the user-visible title of the host app’s tab that shows this composition, and is reported as the composition view’sBooksViewTitleanalytics attribute.Declaration
Swift
@MainActor public func createCompositionViewController( name: String, displayName: String, hostingTabTitle: String? = nil ) -> UIViewController -
Returns a view controller that displays the Browse catalog (the list of book categories). The returned container shows a splash until the library has loaded its content; once ready, the catalog is embedded into it. The surrounding standalone library provides the top bar and miniplayer, so the container hosts only the content.
Declaration
Swift
@MainActor public func createBrowseViewController(groupTitle: String? = nil) -> UIViewController -
Returns a view controller that displays the user’s library (“My Books”). The returned container shows a splash until the library has loaded its content; once ready, the My Books view is embedded into it. The surrounding standalone library provides the top bar and miniplayer, so the container hosts only the content.
Declaration
Swift
@MainActor public func createUserLibraryViewController() -> UIViewController -
Returns a view controller that displays a single podcast series, identified by its series UUID. The returned container shows a splash until the library has loaded its content; once ready, the podcast series screen is embedded into it. The surrounding standalone library provides the top bar and miniplayer, so the container hosts only the content.
Declaration
Swift
@MainActor public func createPodcastSeriesViewController(podcastID: UUID) -> UIViewController -
Returns a view controller that displays a single podcast series, identified by its feed URL. The returned container shows a splash until the library has loaded its content; once ready, the podcast series screen is embedded into it. The surrounding standalone library provides the top bar and miniplayer, so the container hosts only the content.
Declaration
Swift
@MainActor public func createPodcastSeriesViewController(feedURL: URL) -> UIViewController -
Called by the standalone shell when the bottom tab hosting this whole books library becomes visible (the
books_tabsbottom-tab host, e.g. HoustonChronicle). Forwards to the currently visible composition tab so it fires its “did open” analytics event on every visit rather than only once per session. (The swiper top-tab host usesBooksTabVisibilityObservingon the tab container instead.)Declaration
Swift
@MainActor public func hostingTabDidBecomeVisible() -
Undocumented
Declaration
Swift
@MainActor public func createViewController( initialTab: LibraryTab = .discover, splashViewController: UIViewController? = nil, topBarViewController: UIViewController? = nil ) -> UIViewController
-
Undocumented
Declaration
Swift
@MainActor func refreshReadingList()
-
Undocumented
Declaration
Swift
@MainActor func navigate(toTab tab: LibraryTab) -
Undocumented
Declaration
Swift
@MainActor func currentTab() -> LibraryTab? -
Undocumented
Declaration
Swift
@MainActor func tabs() -> [LibraryTab] -
Undocumented
Declaration
Swift
@MainActor func open(_ request: BooksLibraryOpenRequest)
-
Add an analytics event listener.
Declaration
Swift
@MainActor func addAnalyticsListener(_ listener: BooksLibraryEventListener) -
Add an analytics event listener.
Declaration
Swift
@MainActor func removeAnalyticsListener(_ listener: BooksLibraryEventListener)