Skip to main content
←API Reference ←NSDK ←NSDKVps2Session

anchorPayload


Declaration​

func anchorPayload(anchorId: NSDKVpsAnchorId) -> NSDKAsyncState<String, Never>?

Summary​

Gets the payload data of a specified anchor.
The payload encodes the data needed to relocalize an anchor across devices or sessions.
It can be stored and used later with trackAnchor(payload:).
For anchors created via createAnchor(at:), subscribe to createdAnchorPayload
instead of polling this method — the session handles polling automatically.

Returns​

  • .inProgress(nil): The anchor exists but its payload is not available yet. Payloads
    are only generated once the anchor has been tracked.
    - .success(payload): The base64-encoded payload is ready.
    - nil: No anchor with anchorId was found.
Notice

Warning: 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(siteId:), then call trackAnchor(payload:).

Notice

Precondition: anchorId must be exactly 32 characters long.

Parameters​

NameTypeSummary
anchorIdNSDKVpsAnchorId
The unique identifier of the anchor.