Upgrade annotations in PSPDFKit Web 2017.8
PSPDFKit for Web 2017.8 changes annotation IDs from integers to strings.
This requires that all clients (iOS, Android, and Web), along with the server, are updated to the latest version at the same time. If you’re maintaining an Instant setup, make sure to check out the server migration guides.
Annotation API changes
- All
Annotationsubclasses now have a string value for theidfield. This ID will still be generated automatically wheneverInstance#createAnnotationis called. - The concept of local ID and global ID is gone completely. The Web client can now generate a unique string ID, which is also used to reference the annotation when it is saved to Instant or Instant JSON.
Instance#resolveLocalIdwas removed and is now available asInstance#ensureAnnotationSaved. This method still accepts an annotation and will resolve the promise when the annotation is persisted. Theidproperty of the annotation will now stay stable and will no longer be updated when the promise resolves.- The document format of Instant JSON no longer requires the
lastAnnotationIdproperty. Importing the previous version of Instant JSON (with number values for annotation IDs) using theConfig#instantJSONoption is still supported. WhenInstance#exportInstantJSONis called the next time, the format will automatically be upgraded. The IDs of existing annotations will simply be cast to string (so-1will become"-1").
For more details, check out our updated annotation and Instant JSON guides.
For a full list of changes, check out the changelog.