Skip to main content
←API Reference ←com.nianticspatial.nsdk.vps2 ←Vps2Session

getAnchorPayload


Declaration​

fun getAnchorPayload(anchorId: UUID): String?

Summary​

Gets the payload data of a specified anchor.


The payload encodes the data needed to localize an anchor across multiple devices or sessions.
It can be shared or stored for later use with trackAnchor.


Note: an anchor is tied to the site asset it was created against, so it will not resolve
against a different site or a different asset of the same site. To start tracking an anchor
in a different session, first localize to its site with localize, then call trackAnchor.

Returns​

Base64-encoded payload if available, null if the anchor is not yet tracked.

Throws​

  • NsdkInvalidArgumentStatusException — if no anchor with the id anchorId has been created or added for tracking. Check NSDK's C logs for more information.

Parameters​

NameTypeSummary
anchorIdUUID
An NSDK [UUID] (ByteArray, not java.util.UUID) as returned by [trackAnchor] or [createAnchor].