Offline Support


PSPDFKit Instant is designed to be fully functional while the device is offline or the connection is unreliable. Users can continue to create and edit annotations. Instant will automatically sync these when a connection is available later.

Instant stores annotations in a database locally on the device, then synchronizes this with your PSPDFKit Server as soon as a connection is available.

If two users edit the same annotation while offline, this would create a conflict. Instant results conflicts automatically by updating the annotation to the contents set by the first user to reconnect to the server. This is because if several users where offline, this strategy avoids a series of updates when the users reconnect.

If Instant is trying to sync but the device is offline, it will report the error PSPDFInstantErrorRequestFailed (error code 16). Your app can use this in whichever way you find appropriate. Typically updating the user interface to indicate that annotations cannot be synchronized.

Since there is no way to know for sure if a connection is possible without trying, Instant may still attempt to synchronize annotations when there is no connection. If presenting synchronization errors as alerts to the user, we recommend filtering out this error code because users are familiar with connectivity problems and that apps will sync data automatically when a connection is available.

Was this page helpful? We're happy to answer any questions.