anchorPayload
Declaration
func anchorPayload(anchorId: NSDKVpsAnchorId) -> NSDKAsyncState<String, Never>?
Summary
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 withanchorIdwas 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
| Name | Type | Summary |
|---|---|---|
| anchorId | NSDKVpsAnchorId | The unique identifier of the anchor. |
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 tocreatedAnchorPayloadinstead of polling this method — the session handles polling automatically.