[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-14 UTC."],[[["\u003cp\u003e\u003ccode\u003eArHostCloudAnchorFuture\u003c/code\u003e represents an asynchronous operation for hosting a Cloud Anchor, initiated by \u003ccode\u003eArSession_hostCloudAnchorAsync\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eArHostCloudAnchorCallback\u003c/code\u003e is used to receive the Cloud Anchor ID and state upon completion or failure of the hosting operation.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eArHostCloudAnchorFuture_acquireResultCloudAnchorId\u003c/code\u003e retrieves the Cloud Anchor ID if the hosting was successful, returning NULL otherwise.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eArHostCloudAnchorFuture_getResultCloudAnchorState\u003c/code\u003e provides the status of the hosting operation, indicating success, failure, or ongoing progress.\u003c/p\u003e\n"]]],[],null,["# ArHostCloudAnchorFuture\n=======================\n\nAn asynchronous operation for hosting a Cloud Anchor launched by [ArSession_hostCloudAnchorAsync](/ar/reference/c/group/ar-session#arsession_hostcloudanchorasync).\n\nSee the [Cloud Anchors developer guide](https://developers.google.com/ar/develop/c/cloud-anchors/developer-guide) for more information.\n\nSummary\n-------\n\n| ### Typedefs ||\n|-----------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [ArHostCloudAnchorCallback](#arhostcloudanchorcallback)`)(void *context, char *cloud_anchor_id, ArCloudAnchorState cloud_anchor_state)` | typedef `void(*` Callback definition for [ArSession_hostCloudAnchorAsync](/ar/reference/c/group/ar-session#arsession_hostcloudanchorasync). |\n| [ArHostCloudAnchorFuture](#arhostcloudanchorfuture) | typedef `struct ArHostCloudAnchorFuture_` Handle to an asynchronous operation launched by [ArSession_hostCloudAnchorAsync](/ar/reference/c/group/ar-session#arsession_hostcloudanchorasync). |\n\n| ### Functions ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|\n| [ArHostCloudAnchorFuture_acquireResultCloudAnchorId](#arhostcloudanchorfuture_acquireresultcloudanchorid)`(const `[ArSession](/ar/reference/c/group/ar-session#arsession)` *session, const `[ArHostCloudAnchorFuture](/ar/reference/c/group/ar-host-cloud-anchor-future#arhostcloudanchorfuture)` *future, char **out_cloud_anchor_id)` | `void` Gets the Cloud Anchor ID of the hosted anchor. |\n| [ArHostCloudAnchorFuture_getResultCloudAnchorState](#arhostcloudanchorfuture_getresultcloudanchorstate)`(const `[ArSession](/ar/reference/c/group/ar-session#arsession)` *session, const `[ArHostCloudAnchorFuture](/ar/reference/c/group/ar-host-cloud-anchor-future#arhostcloudanchorfuture)` *future, `[ArCloudAnchorState](/ar/reference/c/group/ar-anchor#arcloudanchorstate)` *out_cloud_anchor_state)` | `void` Gets the result status of the hosting operation, if the operation is done. |\n\nTypedefs\n--------\n\n### ArHostCloudAnchorCallback\n\n```scdoc\nvoid(* ArHostCloudAnchorCallback)(void *context, char *cloud_anchor_id, ArCloudAnchorState cloud_anchor_state)\n``` \nCallback definition for [ArSession_hostCloudAnchorAsync](/ar/reference/c/group/ar-session#arsession_hostcloudanchorasync).\n\nThe `context` argument will be the same as that passed to [ArSession_hostCloudAnchorAsync](/ar/reference/c/group/ar-session#arsession_hostcloudanchorasync). The `cloud_anchor_id` argument will contain the same value as that returned by [ArHostCloudAnchorFuture_acquireResultCloudAnchorId](/ar/reference/c/group/ar-host-cloud-anchor-future#arhostcloudanchorfuture_acquireresultcloudanchorid) and must be released using [ArString_release](/ar/reference/c/group/utility-functions#arstring_release). The `cloud_anchor_state` argument will be the same as that returned by [ArHostCloudAnchorFuture_getResultCloudAnchorState](/ar/reference/c/group/ar-host-cloud-anchor-future#arhostcloudanchorfuture_getresultcloudanchorstate).\n\nIt is a best practice to free `context` memory provided to [ArSession_hostCloudAnchorAsync](/ar/reference/c/group/ar-session#arsession_hostcloudanchorasync) at the end of the callback implementation. \n\n### ArHostCloudAnchorFuture\n\n```scdoc\nstruct ArHostCloudAnchorFuture_ ArHostCloudAnchorFuture\n``` \nHandle to an asynchronous operation launched by [ArSession_hostCloudAnchorAsync](/ar/reference/c/group/ar-session#arsession_hostcloudanchorasync).\n\nSee the [Cloud Anchors developer guide](https://developers.google.com/ar/develop/c/cloud-anchors/developer-guide) for more information.\n\nRelease with [ArFuture_release](/ar/reference/c/group/ar-future#arfuture_release). ([reference type, long-lived](/ar/reference/c/group/concepts#object-ownership)).\n\nFunctions\n---------\n\n### ArHostCloudAnchorFuture_acquireResultCloudAnchorId\n\n```gdscript\nvoid ArHostCloudAnchorFuture_acquireResultCloudAnchorId(\n const ArSession *session,\n const ArHostCloudAnchorFuture *future,\n char **out_cloud_anchor_id\n)\n``` \nGets the Cloud Anchor ID of the hosted anchor.\n\nIf the operation isn't done yet or the operation failed, this will be `NULL`. The caller must release the string using [ArString_release](/ar/reference/c/group/utility-functions#arstring_release).\n\n\n| Details ||\n|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |-----------------------|--------------------------------------------| | `session` | The ARCore session. | | `future` | The handle for the asynchronous operation. | | `out_cloud_anchor_id` | The Cloud Anchor ID. | |\n\n### ArHostCloudAnchorFuture_getResultCloudAnchorState\n\n```gdscript\nvoid ArHostCloudAnchorFuture_getResultCloudAnchorState(\n const ArSession *session,\n const ArHostCloudAnchorFuture *future,\n ArCloudAnchorState *out_cloud_anchor_state\n)\n``` \nGets the result status of the hosting operation, if the operation is done.\n\n\n| Details ||\n|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |--------------------------|--------------------------------------------| | `session` | The ARCore session. | | `future` | The handle for the asynchronous operation. | | `out_cloud_anchor_state` | The result status. | |"]]