Readium LCP
Readium LCP is the DRM used by many libraries and
bookstores to lend and sell ebooks. react-native-readium-lcp adds it to react-native-readium
on iOS and Android.
It wraps Readium's LCP module (ReadiumLCP on iOS, readium-lcp on Android) and registers it
with the reader. From JS, you:
- acquire a publication from a license file (
.lcpl); - answer passphrase requests with your own UI;
- read a license's loan and rights, and renew or return it.
Decryption stays native, so protected books read as fast as unprotected ones.
Requirements
react-native-readium5.3.0 or later.- liblcp, EDRLab's private pre-compiled library (
R2LCPClienton iOS). This package can't ship it: contact EDRLab for it and for its integration instructions. They provide test and production builds. - iOS or Android. LCP isn't available on web.
How it fits together
Everything goes through the package's LCP object, an
LcpModule: import { LCP } from 'react-native-readium-lcp'.
- Your build links liblcp, using the values from EDRLab's instructions; see Installation.
- At startup,
LCP.initialize()registers LCP with the reader andLCP.setAuthenticationHandlerconnects your passphrase UI; see Usage. LCP.acquirePublicationdownloads a book from its license, andReadiumViewopens it like any other file.
Known limitations
- Passphrase prompts are always your JS UI; Readium's native dialogs aren't used.
- A loan that can only be renewed through the provider's web page fails with
renewFailed. - On Android, Readium disables text selection in protected publications, so they can't be highlighted.
- Web isn't supported.