Stay organized with collections
Save and categorize content based on your preferences.
GARCloudAnchorMode
Summary
Enumerations
GARCloudAnchorMode
GARCloudAnchorMode
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-14 UTC.
[null,null,["Last updated 2025-07-14 UTC."],[[["\u003cp\u003e\u003ccode\u003eGARCloudAnchorMode\u003c/code\u003e controls the behavior of ARCore's Cloud Anchor API, allowing for persistent anchors across sessions and devices.\u003c/p\u003e\n"],["\u003cp\u003eBy default, Cloud Anchors are disabled (\u003ccode\u003eGARCloudAnchorModeDisabled\u003c/code\u003e), and enabling them (\u003ccode\u003eGARCloudAnchorModeEnabled\u003c/code\u003e) requires configuring token or API key authorization.\u003c/p\u003e\n"],["\u003cp\u003eWhen enabled, Cloud Anchors can be hosted and resolved using dedicated methods within the \u003ccode\u003eGARSession\u003c/code\u003e class.\u003c/p\u003e\n"],["\u003cp\u003eFeature maps are utilized by the Cloud Anchor API to achieve persistence, and further details are available in the Cloud Anchors developer guide.\u003c/p\u003e\n"]]],[],null,["# GARCloudAnchorMode\n==================\n\nSummary\n-------\n\n| ### Enumerations ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------|\n| [GARCloudAnchorMode](#garcloudanchormode)`{` ` `[GARCloudAnchorModeDisabled](#garcloudanchormodedisabled)` = 0,` ` `[GARCloudAnchorModeEnabled](#garcloudanchormodeenabled)` = 1` `}` | enum Describes the desired behavior of the ARCore Cloud Anchor API. |\n\nEnumerations\n------------\n\n### GARCloudAnchorMode\n\n```text\n GARCloudAnchorMode\n``` \nDescribes the desired behavior of the ARCore Cloud Anchor API.\n\nThe Cloud Anchor API uses feature maps to persist an anchor throughout sessions and across devices. See the [Cloud Anchors developer guide](https://developers.google.com/ar/develop/ios/cloud-anchors/developer-guide) for more information.\n\nThe default value is [GARCloudAnchorModeDisabled](/ar/reference/ios/group/GARCloudAnchorMode#garcloudanchormodedisabled). Use [GARSessionConfiguration.cloudAnchorMode](/ar/reference/ios/category/GARSessionConfiguration(CloudAnchors)#cloudanchormode) to set the desired mode.\n\n| Properties ||\n|----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| GARCloudAnchorModeDisabled | The Cloud Anchor API is disabled. Calling [hostCloudAnchor:TTLDays:completionHandler:error: (GARSession(CloudAnchors))](/ar/reference/ios/category/GARSession(CloudAnchors)#hostcloudanchor:ttldays:completionhandler:error:) and [resolveCloudAnchorWithIdentifier:completionHandler:error: (GARSession(CloudAnchors))](/ar/reference/ios/category/GARSession(CloudAnchors)#resolvecloudanchorwithidentifier:completionhandler:error:) will result in [GARSessionErrorCodeIllegalState](/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeillegalstate). This is the default mode. |\n| GARCloudAnchorModeEnabled | The Cloud Anchor API is enabled. [hostCloudAnchor:TTLDays:completionHandler:error: (GARSession(CloudAnchors))](/ar/reference/ios/category/GARSession(CloudAnchors)#hostcloudanchor:ttldays:completionhandler:error:) and [resolveCloudAnchorWithIdentifier:completionHandler:error: (GARSession(CloudAnchors))](/ar/reference/ios/category/GARSession(CloudAnchors)#resolvecloudanchorwithidentifier:completionhandler:error:) can be used to host and resolve Cloud Anchors. Using this mode requires your app to configure [Token authorization or API Key authorization](https://developers.google.com/ar/develop/ios/cloud-anchors/developer-guide#authorization). Use [GARSessionConfiguration.cloudAnchorMode](/ar/reference/ios/category/GARSessionConfiguration(CloudAnchors)#cloudanchormode) to set this mode. |"]]