java.lang.Object | |
↳ | com.pspdfkit.instant.client.InstantClient |
The entry point to PSPDFKit Instant, representing a client’s connection to the Instant server.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static InstantClient |
create(Context context, HttpUrl serverUrl)
Creates instant server client that is going to connect to server at
serverUrl . | ||||||||||
static InstantClient |
create(Context context, URL serverUrl)
Creates instant server client that is going to connect to server at
serverUrl . | ||||||||||
synchronized static InstantClient |
create(Context context, String serverUrl)
Creates instant server client that is going to connect to server at
serverUrl . | ||||||||||
String |
getDataPath()
Returns the data path the client was created with.
| ||||||||||
synchronized InstantDocumentDescriptor |
getInstantDocumentDescriptorForJwt(String jwt)
Returns the document descriptor matching the data encoded in the given JWT.
| ||||||||||
synchronized List<InstantDocumentDescriptor> |
getLocalDocumentDescriptors()
Returns document descriptors for locally cached documents.
| ||||||||||
String |
getServerUrl()
Returns the server URL the client was created with.
| ||||||||||
InstantPdfDocument |
openDocument(String jwt)
Downloads and opens document from instant server synchronously.
| ||||||||||
Single<InstantPdfDocument> |
openDocumentAsync(String jwt)
Downloads and opens document from instant server, asynchronously.
| ||||||||||
synchronized void |
removeLocalStorage()
Removes local storage for this client.
| ||||||||||
synchronized void |
removeLocalStorageForDocument(String documentId)
Invalidates all layers of the document with the given ID and removes its local storage.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Creates instant server client that is going to connect to server at serverUrl
.
context | The context to use |
---|---|
serverUrl | Instant server url. |
InstantException | when creating the client fails. This can happen due to permission errors or disk corruption |
---|
Creates instant server client that is going to connect to server at serverUrl
.
context | The context to use |
---|---|
serverUrl | Instant server url. |
InstantException | when creating the client fails. This can happen due to permission errors or disk corruption |
---|
Creates instant server client that is going to connect to server at serverUrl
.
context | The context to use |
---|---|
serverUrl | Instant server url. |
InstantException | when creating the client fails. This can happen due to permission errors or disk corruption |
---|
Returns the document descriptor matching the data encoded in the given JWT.
jwt | The JWT defining the document and its layer. Obtain this from your backend. |
---|
InstantException | when the JWT cannot be parsed, the data on disk could not be accessed (e.g. due to permission errors, or data corruption), or when the data on disk belongs to another user than what is encoded in the JWT. |
---|
Returns document descriptors for locally cached documents. You can use this to access documents that are already downloaded and cached on the device, even while the device is offline.
Downloads and opens document from instant server synchronously.
jwt | The JWT defining the document and its layer. |
---|
InstantPdfDocument
).InstantDownloadException | when server document download fails. |
---|---|
InstantException | when the document data on disk could not be accessed (e.g. due to permission errors, or data corruption), or when the data on disk belongs to another user than what is encoded in the JWT. |
Downloads and opens document from instant server, asynchronously.
openDocumentAsync
does not operate by default on a particular Scheduler.
jwt | The JWT defining the document and its layer. |
---|
InstantPdfDocument
or an error when document could
not be downloaded or opened.
Removes local storage for this client. This includes all documents and other client data. All opened documents will get invalidated.
Use this method to remove locally cached Instant documents when you no longer need them on the device (e.g. when signing out).
InstantException | when removing local storage failed. |
---|
Invalidates all layers of the document with the given ID and removes its local storage.
Use this method to remove locally cached data for a single Instant document when you no longer need it on the device.
InstantException | when removing local storage failed. |
---|