C Specification

The xrShareAnchorANDROID function is defined as:

// Provided by XR_ANDROID_anchor_sharing_export
XrResult xrShareAnchorANDROID(
    XrSession                                   session,
    const XrAnchorSharingInfoANDROID*           sharingInfo,
    XrAnchorSharingTokenANDROID*                anchorToken);

Parameters

Parameter Descriptions

Description

The xrShareAnchorANDROID function returns a share token to the application. The application can share this token with other applications to give them access to the pose data of XrAnchorSharingInfoANDROID::anchor.

The runtime must return XR_ERROR_ANCHOR_NOT_OWNED_BY_CALLER_ANDROID if XrAnchorSharingInfoANDROID::anchor was not originally created by the application that calls xrShareAnchorANDROID.

If the application calls xrShareAnchorANDROID for the same XrAnchorSharingInfoANDROID::anchor multiple times without unsharing it first, the runtime must return the same share token each time.

If the application calls xrShareAnchorANDROID for an anchor that was previously shared but then unshared, the runtime may return a share token that is different from the previous sharing scope. The lifetime of the anchorToken share token is limited to the application controlled share-unshare scope.

Valid Usage (Implicit)
Return Codes
On success, this command returns
  • XR_SUCCESS

  • XR_SESSION_LOSS_PENDING

On failure, this command returns
  • XR_ERROR_FUNCTION_UNSUPPORTED

  • XR_ERROR_VALIDATION_FAILURE

  • XR_ERROR_RUNTIME_FAILURE

  • XR_ERROR_HANDLE_INVALID

  • XR_ERROR_INSTANCE_LOST

  • XR_ERROR_SESSION_LOST

  • XR_ERROR_OUT_OF_MEMORY

  • XR_ERROR_ANCHOR_NOT_OWNED_BY_CALLER_ANDROID

See Also

Document Notes

For more information, see the OpenXR Specification

This page is extracted from the OpenXR Specification. Fixes and changes should be made to the Specification, not directly.

Copyright 2014-2025 The Khronos Group Inc.