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

trackAnchor


Declaration​

fun trackAnchor(payload: String): UUID

Summary​

Start tracking an anchor specified by a base64 payload.


Use this only to restore an AR anchor the app created itself with createAnchor and saved
with getAnchorPayload.


Note: an anchor payload is no longer the preferred method to identify the map to localize
against: target a map by site ID with localize or by coordinate with its lat/long
overload. 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.

Returns​

The anchor's unique id — an NSDK UUID (typealias UUID = ByteArray, a 32-byte ASCII uppercase-hex id, not java.util.UUID). Use anchorIdToString for a printable string.

Throws​

  • NsdkInvalidArgumentStatusException — if the payload is invalid. Check NSDK's C logs for more information.

Parameters​

NameTypeSummary
payloadString
-