Skip to content

Extract the LCP persistence layer #442

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 29, 2024
Merged

Extract the LCP persistence layer #442

merged 4 commits into from
May 29, 2024

Conversation

mickael-menu
Copy link
Member

The Readium LCP persistence layer was extracted to allow applications to provide their own implementations. The previous implementation is now part of a new package, ReadiumAdapterLCPSQLite, which you need to use to maintain the same behavior as before.

To use ReadiumAdapterLCPSQLite, you must update your imports and the dependencies included in your project:

  • Swift Package Manager:
    • Add the ReadiumAdapterLCPSQLite package to your project dependencies.
  • Carthage:
    • Update the Carthage dependencies and make sure the new ReadiumAdapterLCPSQLite.xcframework was built.
    • Add this new framework to your project dependencies.
  • CocoaPods:
    • Update the pod statements in your Podfile with the following, before running pod install:
      pod 'ReadiumAdapterLCPSQLite', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/3.0.0/Support/CocoaPods/ReadiumAdapterLCPSQLite.podspec'
      

Then, provide the adapters when initializing the LCPService.

import ReadiumAdapterLCPSQLite
import ReadiumLCP

let lcpService = LCPService(
    client: LCPClient(),
    licenseRepository: LCPSQLiteLicenseRepository(),
    passphraseRepository: LCPSQLitePassphraseRepository(),
    httpClient: DefaultHTTPClient()
)

@mickael-menu mickael-menu merged commit c94c500 into develop May 29, 2024
6 checks passed
@mickael-menu mickael-menu deleted the lcp-sqlite-adapter branch May 29, 2024 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant