# GARSession

ARCore session class.

Adds **ARCore** features to an app using **ARKit** . All `NSError`'s returned by methods in this class have domain `GARSessionErrorDomain` and code a value of `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcode`. For Augmented Faces, see `https://developers.google.com/ar/reference/ios/interface/GARAugmentedFaceSession#interface_g_a_r_augmented_face_session`. See categories of this class for other features. Each feature must be turned on by using `https://developers.google.com/ar/reference/ios/interface/GARSession#setconfiguration:error:` prior to use.

## Summary

### Inheritance

Inherits from: `NSObject`

| ### Properties ||
|---|---|
| `https://developers.google.com/ar/reference/ios/interface/GARSession#currentframepair` | `https://developers.google.com/ar/reference/ios/interface/GARFramePair#interface_g_a_r_frame_pair *` The most recent frame pair, containing the most recent `ARFrame` passed into `https://developers.google.com/ar/reference/ios/interface/GARSession#update:error:` and the corresponding returned `https://developers.google.com/ar/reference/ios/interface/GARFrame#interface_g_a_r_frame`. |
| `https://developers.google.com/ar/reference/ios/interface/GARSession#delegate` | `id< https://developers.google.com/ar/reference/ios/protocol/GARSessionDelegateP#protocol_g_a_r_session_delegate-p >` The delegate for receiving callbacks about the `https://developers.google.com/ar/reference/ios/interface/GARSession#interface_g_a_r_session`. |
| `https://developers.google.com/ar/reference/ios/interface/GARSession#delegatequeue` | `dispatch_queue_t` The dispatch queue on which the delegate receives calls. |

| ### Public static methods ||
|---|---|
| `https://developers.google.com/ar/reference/ios/interface/GARSession#sessionwithapikey:bundleidentifier:error:` | `nullable instancetype` Creates a `https://developers.google.com/ar/reference/ios/interface/GARSession#interface_g_a_r_session` with an API key and bundle identifier. |
| `https://developers.google.com/ar/reference/ios/interface/GARSession#sessionwitherror:` | `nullable instancetype` Creates a `https://developers.google.com/ar/reference/ios/interface/GARSession#interface_g_a_r_session`. |

| ### Public methods ||
|---|---|
| `https://developers.google.com/ar/reference/ios/interface/GARSession#checkvpsavailabilityatcoordinate:completionhandler:` | `https://developers.google.com/ar/reference/ios/interface/GARVPSAvailabilityFuture#interface_g_a_r_v_p_s_availability_future *` Gets the availability of the Visual Positioning System (VPS) at a specified horizontal position. |
| `https://developers.google.com/ar/reference/ios/interface/GARSession#createanchoronstreetscapegeometry:transform:error:` | `nullable https://developers.google.com/ar/reference/ios/interface/GARAnchor#interface_g_a_r_anchor *` Creates an anchor at the given transform in the world coordinate space, attached to this `https://developers.google.com/ar/reference/ios/interface/GARStreetscapeGeometry#interface_g_a_r_streetscape_geometry`, and acquires a reference to it. |
| `https://developers.google.com/ar/reference/ios/interface/GARSession#createanchorwithcoordinate:altitude:eastupsouthqanchor:error:` | `nullable https://developers.google.com/ar/reference/ios/interface/GARAnchor#interface_g_a_r_anchor *` Creates a Geospatial anchor at the specified geodetic location and orientation relative to the Earth. |
| `https://developers.google.com/ar/reference/ios/interface/GARSession#createanchorwithcoordinate:altitudeaboverooftop:eastupsouthqanchor:completionhandler:error:` | `nullable https://developers.google.com/ar/reference/ios/interface/GARCreateAnchorOnRooftopFuture#interface_g_a_r_create_anchor_on_rooftop_future *` Asynchronously creates a Rooftop anchor at the specified horizontal position and altitude relative to the horizontal position's rooftop. |
| `https://developers.google.com/ar/reference/ios/interface/GARSession#createanchorwithcoordinate:altitudeaboveterrain:eastupsouthqanchor:completionhandler:error:` | `nullable https://developers.google.com/ar/reference/ios/interface/GARCreateAnchorOnTerrainFuture#interface_g_a_r_create_anchor_on_terrain_future *` Asynchronously creates a Terrain anchor at a specified horizontal position and altitude relative to the horizontal position's terrain. |
| `https://developers.google.com/ar/reference/ios/interface/GARSession#createanchorwithcoordinate:altitudeaboveterrain:eastupsouthqanchor:error:` | `nullable https://developers.google.com/ar/reference/ios/interface/GARAnchor#interface_g_a_r_anchor *` Creates a Terrain anchor at the specified geodetic location, altitude relative to the horizontal position's terrain and orientation relative to the Earth. |
| `https://developers.google.com/ar/reference/ios/interface/GARSession#estimatefeaturemapqualityforhosting:error:` | `https://developers.google.com/ar/reference/ios/group/GARFeatureMapQuality#garfeaturemapquality` Estimates the quality of the visual features seen by ARCore in the preceding few seconds and visible from the provided camera transform. |
| `https://developers.google.com/ar/reference/ios/interface/GARSession#geospatialtransformfromtransform:error:` | `nullable https://developers.google.com/ar/reference/ios/interface/GARGeospatialTransform#interface_g_a_r_geospatial_transform *` Converts the provided transform to a `https://developers.google.com/ar/reference/ios/interface/GARGeospatialTransform#interface_g_a_r_geospatial_transform` with respect to the Earth. |
| `https://developers.google.com/ar/reference/ios/interface/GARSession#hostcloudanchor:ttldays:completionhandler:error:` | `nullable https://developers.google.com/ar/reference/ios/interface/GARHostCloudAnchorFuture#interface_g_a_r_host_cloud_anchor_future *` Uses the transform and other data from `anchor` to host a new Cloud Anchor. |
| `https://developers.google.com/ar/reference/ios/interface/GARSession#hostcloudanchor:ttldays:error:` | `nullable https://developers.google.com/ar/reference/ios/interface/GARAnchor#interface_g_a_r_anchor *` This will create a new Cloud Anchor with a given lifetime in days, using the transform of the provided anchor. |
| `https://developers.google.com/ar/reference/ios/interface/GARSession#hostcloudanchor:error:` | `nullable https://developers.google.com/ar/reference/ios/interface/GARAnchor#interface_g_a_r_anchor *` Hosts a new Cloud Anchor based on an `ARAnchor`. |
| `https://developers.google.com/ar/reference/ios/interface/GARSession#isgeospatialmodesupported:` | `BOOL` Determines whether the given geospatial mode is supported on the current device and OS version. |
| `https://developers.google.com/ar/reference/ios/interface/GARSession#issemanticmodesupported:` | `BOOL` Determines whether the given `https://developers.google.com/ar/reference/ios/group/GARSemanticMode#garsemanticmode` is supported on the current device and OS version. |
| `https://developers.google.com/ar/reference/ios/interface/GARSession#raycaststreetscapegeometry:direction:error:` | `nullable NSArray< https://developers.google.com/ar/reference/ios/interface/GARStreetscapeGeometryRaycastResult#interface_g_a_r_streetscape_geometry_raycast_result * > *` Performs a raycast against Streetscape Geometry loaded by the scene. |
| `https://developers.google.com/ar/reference/ios/interface/GARSession#removeanchor:` | `void` Removes an anchor from the session. |
| `https://developers.google.com/ar/reference/ios/interface/GARSession#resolvecloudanchorwithidentifier:completionhandler:error:` | `nullable https://developers.google.com/ar/reference/ios/interface/GARResolveCloudAnchorFuture#interface_g_a_r_resolve_cloud_anchor_future *` Attempts to resolve a Cloud Anchor using the provided `identifier`. |
| `https://developers.google.com/ar/reference/ios/interface/GARSession#resolvecloudanchorwithidentifier:error:` | `nullable https://developers.google.com/ar/reference/ios/interface/GARAnchor#interface_g_a_r_anchor *` Resolves a Cloud Anchor with a given identifier. |
| `https://developers.google.com/ar/reference/ios/interface/GARSession#setauthtoken:` | `void` Provide an auth token to use when authenticating with Google Cloud Services. |
| `https://developers.google.com/ar/reference/ios/interface/GARSession#setconfiguration:error:` | `void` Sets the configuration for the session. |
| `https://developers.google.com/ar/reference/ios/interface/GARSession#transformfromgeospatialcoordinate:altitude:eastupsouthqtarget:error:` | `matrix_float4x4` Converts the provided Earth specified horizontal position, altitude and rotation with respect to an east-up-south coordinate frame to a local transform in world coordinate space. |
| `https://developers.google.com/ar/reference/ios/interface/GARSession#update:error:` | `nullable https://developers.google.com/ar/reference/ios/interface/GARFrame#interface_g_a_r_frame *` Updates the `https://developers.google.com/ar/reference/ios/interface/GARSession#interface_g_a_r_session` with an `ARFrame`. |

## Properties

### currentFramePair

```
@property(atomic, readonly, nullable) https://developers.google.com/ar/reference/ios/interface/GARFramePair#interface_g_a_r_frame_pair *https://developers.google.com/ar/reference/ios/interface/GARSession#currentframepair;
```
The most recent frame pair, containing the most recent `ARFrame` passed into `https://developers.google.com/ar/reference/ios/interface/GARSession#update:error:` and the corresponding returned `https://developers.google.com/ar/reference/ios/interface/GARFrame#interface_g_a_r_frame`.

### delegate

```
@property(atomic, weak, nullable) id https://developers.google.com/ar/reference/ios/interface/GARSession#delegate;
```
The delegate for receiving callbacks about the `https://developers.google.com/ar/reference/ios/interface/GARSession#interface_g_a_r_session`.

### delegateQueue

```
@property(atomic, nullable) dispatch_queue_t https://developers.google.com/ar/reference/ios/interface/GARSession#delegatequeue;
```
The dispatch queue on which the delegate receives calls.

If `nil`, callbacks happen on the main thread.

## Public static methods

### sessionWithAPIKey:bundleIdentifier:error:

```
+ (nullable instancetype)sessionWithAPIKey:(NSString *) apiKeybundleIdentifier:(nullable NSString *) bundleIdentifiererror:(NSError **) error
```
Creates a `https://developers.google.com/ar/reference/ios/interface/GARSession#interface_g_a_r_session` with an API key and bundle identifier.


Details Parameters `apiKey` Your API key for **Google Cloud Services**. `bundleIdentifier` The bundle identifier associated to your API key. If `nil`, defaults to `[[NSBundle mainBundle] bundleIdentifier]`. `error` Out parameter for an `NSError`. Possible errors:

- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodedevicenotcompatible` - this device or OS version is not currently supported.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeinvalidargument` - API key is `nil` or empty.
**Returns** The new `https://developers.google.com/ar/reference/ios/interface/GARSession#interface_g_a_r_session`, or `nil` if there is an error.

### sessionWithError:

```
+ (nullable instancetype)sessionWithError:(NSError **) error
```
Creates a `https://developers.google.com/ar/reference/ios/interface/GARSession#interface_g_a_r_session`.

To authenticate with Google Cloud Services, use `https://developers.google.com/ar/reference/ios/interface/GARSession#setauthtoken:`.


Details Parameters `error` Out parameter for an `NSError`. Possible errors:

- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodedevicenotcompatible` - this device or OS version is not currently supported.
**Returns** The new [GARSession](https://developers.google.com/ar/reference/ios/interface/GARSession#interface_g_a_r_session), or `nil` if there is an error.

## Public methods

### checkVPSAvailabilityAtCoordinate:completionHandler:

```
- (https://developers.google.com/ar/reference/ios/interface/GARVPSAvailabilityFuture#interface_g_a_r_v_p_s_availability_future *)checkVPSAvailabilityAtCoordinate:(CLLocationCoordinate2D) coordinatecompletionHandler:(void(^)(https://developers.google.com/ar/reference/ios/group/GARVPSAvailability#garvpsavailability availability)) completionHandler
```
Gets the availability of the Visual Positioning System (VPS) at a specified horizontal position.

The availability of VPS in a given location helps to improve the quality of Geospatial localization and tracking accuracy.

This launches an asynchronous operation used to query the Google Cloud ARCore API. See `https://developers.google.com/ar/reference/ios/interface/GARFuture#interface_g_a_r_future` for information on obtaining results and cancelling the operation.

Your app must be properly set up to communicate with the Google Cloud ARCore API in order to obtain a result from this call. See [Check VPS Availability](https://developers.google.com/ar/develop/ios/geospatial/check-vps-availability) for more details on setup steps and usage examples.


Details Parameters `coordinate` The coordinate at which to check availability. `completionHandler` [Completion handler](https://developers.google.com/ar/reference/ios/interface/GARFuture-1future#using-a-completion-handler-to-obtain-future-results) to be invoked on the Main thread, if not `nil`. **Returns** A handle to the async operation that can be [polled](https://developers.google.com/ar/reference/ios/interface/GARFuture-1future#polling-a-future) or [cancelled](https://developers.google.com/ar/reference/ios/interface/GARFuture-1future#cancelling-a-future). Provided by category `https://developers.google.com/ar/reference/ios/category/GARSession(Geospatial)#category_g_a_r_session_07_geospatial_08_1ab4c2672d3a5f1869663ddb72d1c83189`.

### createAnchorOnStreetscapeGeometry:transform:error:

```
- (nullable https://developers.google.com/ar/reference/ios/interface/GARAnchor#interface_g_a_r_anchor *)createAnchorOnStreetscapeGeometry:(https://developers.google.com/ar/reference/ios/interface/GARStreetscapeGeometry#interface_g_a_r_streetscape_geometry *) geometrytransform:(matrix_float4x4) transformerror:(NSError **) error
```
Creates an anchor at the given transform in the world coordinate space, attached to this `https://developers.google.com/ar/reference/ios/interface/GARStreetscapeGeometry#interface_g_a_r_streetscape_geometry`, and acquires a reference to it.


Details Parameters `geometry` The object that this anchor will be attached to. `transform` The local transform in world coordinate space. `error` Out param for an `NSError`. Possible error codes:

- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeillegalstate` - current geospatial mode is disabled, or Streetscape Geometry mode is disabled.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodenottracking` - Earth, Session or geometry's `ARTrackingState` is not `https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstatetracking`.
**Returns** The new anchor, or `nil` if there was an error. Provided by category `https://developers.google.com/ar/reference/ios/category/GARSession(Geospatial)#category_g_a_r_session_07_geospatial_08_1ab595dab465f891d0b7f9c17780cba609`.

### createAnchorWithCoordinate:altitude:eastUpSouthQAnchor:error:

```
- (nullable https://developers.google.com/ar/reference/ios/interface/GARAnchor#interface_g_a_r_anchor *)createAnchorWithCoordinate:(CLLocationCoordinate2D) coordinatealtitude:(CLLocationDistance) altitudeeastUpSouthQAnchor:(simd_quatf) eastUpSouthQAnchorerror:(NSError **) error
```
Creates a Geospatial anchor at the specified geodetic location and orientation relative to the Earth.

Latitude and longitude are defined by the [WGS84 specification](https://en.wikipedia.org/wiki/World_Geodetic_System), and altitude values are defined as the elevation above the WGS84 ellipsoid in meters.

The rotation provided by `eastUpSouthQAnchor` is a rotation with respect to an east-up-south coordinate frame. An identity rotation will have the anchor oriented such that X+ points to the east, Y+ points up away from the center of the earth, and Z+ points to the south.

An anchor's `https://developers.google.com/ar/reference/ios/interface/GARAnchor#trackingstate` will be `https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstatepaused` while `https://developers.google.com/ar/reference/ios/interface/GAREarth#interface_g_a_r_earth` is `https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstatepaused`. The tracking state will permanently become `https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstatestopped` if the `https://developers.google.com/ar/reference/ios/interface/GARSession#interface_g_a_r_session` configuration is set to `https://developers.google.com/ar/reference/ios/group/GARGeospatialMode#gargeospatialmodedisabled`.

Creating anchors near the north pole or south pole is not supported. If the latitude is within 0.1° of the north pole or south pole (90° or -90 °), this function will output `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeinvalidargument` and the anchor will fail to be created.


Details Parameters `coordinate` The latitude and longitude associated with the location, specified using the WGS84 reference frame. This must not be within .1° of the North or South pole (i.e. +- 90°). `altitude` Altitude in reference to the WGS 84 ellipsoid, in meters. Positive values indicate altitudes above approximate sea level. Negative values indicate altitudes below approximate sea level. `eastUpSouthQAnchor` Represents the quaternion from the anchor to East-Up-South (EUS) coordinates (i.e., +X points East, +Y points up, and +Z points South). `error` Out param for an `NSError`. Possible error codes:

- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeillegalstate` - current Geospatial mode is disabled or earth has trackingState `https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstatestopped`.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeinvalidargument` - latitude is not within range.
**Returns** The new anchor, or `nil` if there was an error. Provided by category `https://developers.google.com/ar/reference/ios/category/GARSession(Geospatial)#category_g_a_r_session_07_geospatial_08_1a9cdd023e54e8e901277f44a9213a7496`.

### createAnchorWithCoordinate:altitudeAboveRooftop:eastUpSouthQAnchor:completionHandler:error:

```
- (nullable https://developers.google.com/ar/reference/ios/interface/GARCreateAnchorOnRooftopFuture#interface_g_a_r_create_anchor_on_rooftop_future *)createAnchorWithCoordinate:(CLLocationCoordinate2D) coordinatealtitudeAboveRooftop:(CLLocationDistance) altitudeAboveRooftopeastUpSouthQAnchor:(simd_quatf) eastUpSouthQAnchorcompletionHandler:(void(^)(https://developers.google.com/ar/reference/ios/interface/GARAnchor#interface_g_a_r_anchor *_Nullable anchor, https://developers.google.com/ar/reference/ios/group/GARRooftopAnchorState#garrooftopanchorstate rooftopState)) completionHandlererror:(NSError **) error
```
Asynchronously creates a Rooftop anchor at the specified horizontal position and altitude relative to the horizontal position's rooftop.

See the [Rooftop anchors developer guide](https://developers.google.com/ar/develop/ios/geospatial/anchors#rooftop-anchors) for more information.

The specified `altitudeAboveRooftop` is interpreted to be relative to the top of a building at the given horizontal location, rather than relative to the WGS84 ellipsoid. If there is no building at the given location, then the altitude is interpreted to be relative to the terrain instead. Specifying an altitude of 0 will position the anchor directly on the rooftop whereas specifying a positive altitude will position the anchor above the rooftop, against the direction of gravity.

This launches an asynchronous operation used to query the Google Cloud ARCore API. See `https://developers.google.com/ar/reference/ios/interface/GARFuture#interface_g_a_r_future` for information on obtaining results and cancelling the operation.

You may resolve multiple anchors at a time, but a session cannot be tracking more than 100 Rooftop or Terrain anchors at time. Attempting to resolve more than 100 Rooftop or Terrain anchors will result in `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcoderesourceexhausted`.

Latitude and longitude are defined by the [WGS84 specification](https://en.wikipedia.org/wiki/World_Geodetic_System), and altitude values are defined as the elevation above the WGS84 ellipsoid in meters.

The rotation provided by `eastUpSouthQAnchor` is a rotation with respect to an east-up-south coordinate frame. An identity rotation will have the anchor oriented such that X+ points to the east, Y+ points up away from the center of the earth, and Z+ points to the south.

An anchor's `https://developers.google.com/ar/reference/ios/interface/GARAnchor#trackingstate` will be `https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstatetracking` while `https://developers.google.com/ar/reference/ios/interface/GAREarth#interface_g_a_r_earth` is `https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstatetracking`. The tracking state will permanently become `https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstatestopped` if the `https://developers.google.com/ar/reference/ios/interface/GARSession#interface_g_a_r_session` configuration is set to `https://developers.google.com/ar/reference/ios/group/GARGeospatialMode#gargeospatialmodedisabled`.

Creating anchors near the north pole or south pole is not supported. If the latitude is within 0.1° of the north pole or south pole (90° or -90°), this function will output `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeinvalidargument` and the anchor will fail to be created.


Details Parameters `coordinate` The latitude and longitude associated with the location, specified using the WGS84 reference frame. This must not be within .1° of the North or South pole (i.e. +- 90°). `altitudeAboveRooftop` Altitude above Earth's rooftop or terrain, in meters. `eastUpSouthQAnchor` Represents the quaternion from the anchor to East-Up-South (EUS) coordinates (i.e., +X points East, +Y points up, and +Z points South). `completionHandler` [Completion handler](https://developers.google.com/ar/reference/ios/interface/GARFuture-1future#using-a-completion-handler-to-obtain-future-results) to be invoked on the Main thread, if not `nil`. `error` Out param for an `NSError`. Possible error codes:

- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeillegalstate` - current Geospatial mode is disabled or earth has trackingState `https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstatestopped`.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeinvalidargument` - latitude is not within range.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcoderesourceexhausted` - tried to create too many Rooftop or Terrain anchors.
**Returns** A handle to the async operation that can be [polled](https://developers.google.com/ar/reference/ios/interface/GARFuture-1future#polling-a-future) or [cancelled](https://developers.google.com/ar/reference/ios/interface/GARFuture-1future#cancelling-a-future). Provided by category `https://developers.google.com/ar/reference/ios/category/GARSession(Geospatial)#category_g_a_r_session_07_geospatial_08_1a7327572429710f770728700026cda16f`.

### createAnchorWithCoordinate:altitudeAboveTerrain:eastUpSouthQAnchor:completionHandler:error:

```
- (nullable https://developers.google.com/ar/reference/ios/interface/GARCreateAnchorOnTerrainFuture#interface_g_a_r_create_anchor_on_terrain_future *)createAnchorWithCoordinate:(CLLocationCoordinate2D) coordinatealtitudeAboveTerrain:(CLLocationDistance) altitudeAboveTerraineastUpSouthQAnchor:(simd_quatf) eastUpSouthQAnchorcompletionHandler:(void(^)(https://developers.google.com/ar/reference/ios/interface/GARAnchor#interface_g_a_r_anchor *_Nullable anchor, https://developers.google.com/ar/reference/ios/group/GARTerrainAnchorState#garterrainanchorstate terrainState)) completionHandlererror:(NSError **) error
```
Asynchronously creates a Terrain anchor at a specified horizontal position and altitude relative to the horizontal position's terrain.

See the [Terrain anchors developer guide](https://developers.google.com/ar/develop/geospatial/ios/anchors#terrain-anchors) for more information.

The specified `altitudeAboveTerrain` is interpreted to be relative to the Earth's terrain (or floor) at the specified latitude/longitude geodetic coordinates, rather than relative to the WGS-84 ellipsoid. Specifying an `altitudeAboveTerrain` of 0 will position the anchor directly on the terrain whereas specifying a positive `altitudeAboveTerrain` will position the anchor above the terrain, against the direction of gravity.

This launches an asynchronous operation used to query the Google Cloud ARCore API. See `https://developers.google.com/ar/reference/ios/interface/GARFuture#interface_g_a_r_future` for information on obtaining results and cancelling the operation.

You may resolve multiple anchors at a time, but a session cannot be tracking more than 100 Rooftop or Terrain anchors at time. Attempting to resolve more than 100 Rooftop or Terrain anchors will result in `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcoderesourceexhausted`.

Latitude and longitude are defined by the [WGS84 specification](https://en.wikipedia.org/wiki/World_Geodetic_System), and altitude values are defined as the elevation above the WGS84 ellipsoid in meters.

The rotation provided by `eastUpSouthQAnchor` is a rotation with respect to an east-up-south coordinate frame. An identity rotation will have the anchor oriented such that X+ points to the east, Y+ points up away from the center of the earth, and Z+ points to the south.

An anchor's `https://developers.google.com/ar/reference/ios/interface/GARAnchor#trackingstate` will be `https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstatetracking` while `https://developers.google.com/ar/reference/ios/interface/GAREarth#interface_g_a_r_earth` is `https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstatetracking`. The tracking state will permanently become `https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstatestopped` if the `https://developers.google.com/ar/reference/ios/interface/GARSession#interface_g_a_r_session` configuration is set to `https://developers.google.com/ar/reference/ios/group/GARGeospatialMode#gargeospatialmodedisabled`.

Creating anchors near the north pole or south pole is not supported. If the latitude is within 0.1° of the north pole or south pole (90° or -90°), this function will output `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeinvalidargument` and the anchor will fail to be created.


Details Parameters `coordinate` The latitude and longitude associated with the location, specified using the WGS84 reference frame. This must not be within .1° of the North or South pole (i.e. +- 90°). `altitudeAboveTerrain` Altitude above Earth's terrain, in meters. `eastUpSouthQAnchor` Represents the quaternion from the anchor to East-Up-South (EUS) coordinates (i.e., +X points East, +Y points up, and +Z points South). `completionHandler` [Completion handler](https://developers.google.com/ar/reference/ios/interface/GARFuture-1future#using-a-completion-handler-to-obtain-future-results) to be invoked on the Main thread, if not `nil`. `error` Out param for an `NSError`. Possible error codes:

- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeillegalstate` - current Geospatial mode is disabled or earth has trackingState `https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstatestopped`.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeinvalidargument` - latitude is not within range.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcoderesourceexhausted` - tried to create too many Rooftop or Terrain anchors.
**Returns** A handle to the async operation that can be [polled](https://developers.google.com/ar/reference/ios/interface/GARFuture-1future#polling-a-future) or [cancelled](https://developers.google.com/ar/reference/ios/interface/GARFuture-1future#cancelling-a-future). Provided by category `https://developers.google.com/ar/reference/ios/category/GARSession(Geospatial)#category_g_a_r_session_07_geospatial_08_1a6f0d8ed8eb67b2cbf00e8ad57ff92755`.

### createAnchorWithCoordinate:altitudeAboveTerrain:eastUpSouthQAnchor:error:

```
- (nullable https://developers.google.com/ar/reference/ios/interface/GARAnchor#interface_g_a_r_anchor *)createAnchorWithCoordinate:(CLLocationCoordinate2D) coordinatealtitudeAboveTerrain:(CLLocationDistance) altitudeAboveTerraineastUpSouthQAnchor:(simd_quatf) eastUpSouthQAnchorerror:(NSError **) error
```
Creates a Terrain anchor at the specified geodetic location, altitude relative to the horizontal position's terrain and orientation relative to the Earth.

Terrain means the ground, or ground floor inside a building with VPS coverage.

The specified `altitudeAboveTerrain` is interpreted to be relative to the Earth's terrain (or floor) at the specified latitude/longitude geodetic coordinates, rather than relative to the WGS-84 ellipsoid. Specifying an `altitudeAboveTerrain` of 0 will position the anchor directly on the terrain (or floor) whereas specifying a positive `altitudeAboveTerrain` will position the anchor above the terrain (or floor), against the direction of gravity.

This function schedules a task to resolve the anchor's pose using the given parameters. You may resolve multiple anchors at a time, but a session cannot be tracking more than 100 Terrain anchors at time. Attempting to resolve more than 100 Terrain anchors will result in `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcoderesourceexhausted`.

If this function returns error nil, the terrain anchor's `https://developers.google.com/ar/reference/ios/category/GARAnchor(Geospatial)#terrainstate` will be `https://developers.google.com/ar/reference/ios/group/GARTerrainAnchorState#garterrainanchorstatetaskinprogress`, and its tracking state will be `https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstatepaused`. This anchor remains in this state until its pose has been successfully resolved. If the resolving task results in an error, the tracking state will be set to `https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstatestopped`.

Latitude and longitude are defined by the [WGS84 specification](https://en.wikipedia.org/wiki/World_Geodetic_System), and altitude values are defined as the elevation above the WGS84 ellipsoid in meters.

The rotation provided by `eastUpSouthQAnchor` is a rotation with respect to an east-up-south coordinate frame. An identity rotation will have the anchor oriented such that X+ points to the east, Y+ points up away from the center of the earth, and Z+ points to the south.

An anchor's `https://developers.google.com/ar/reference/ios/interface/GARAnchor#trackingstate` will be `https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstatetracking` while `https://developers.google.com/ar/reference/ios/interface/GAREarth#interface_g_a_r_earth` is `https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstatetracking`. The tracking state will permanently become `https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstatestopped` if the `https://developers.google.com/ar/reference/ios/interface/GARSession#interface_g_a_r_session` configuration is set to `https://developers.google.com/ar/reference/ios/group/GARGeospatialMode#gargeospatialmodedisabled`.

Creating anchors near the north pole or south pole is not supported. If the latitude is within 0.1° of the north pole or south pole (90° or -90°), this function will output `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeinvalidargument` and the anchor will fail to be created.


Details Parameters `coordinate` The latitude and longitude associated with the location, specified using the WGS84 reference frame. This must not be within .1° of the North or South pole (i.e. +- 90°). `altitudeAboveTerrain` Altitude above Earth's terrain, in meters. `eastUpSouthQAnchor` Represents the quaternion from the anchor to East-Up-South (EUS) coordinates (i.e., +X points East, +Y points up, and +Z points South). `error` Out param for an `NSError`. Possible error codes:

- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeillegalstate` - current Geospatial mode is disabled or earth has trackingState `https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstatestopped`.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeinvalidargument` - latitude is not within range.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcoderesourceexhausted` - tried to create too many Rooftop or Terrain anchors.
**Returns** The new anchor, or `nil` if there was an error. Provided by category `https://developers.google.com/ar/reference/ios/category/GARSession(Geospatial)#category_g_a_r_session_07_geospatial_08_1a5f5941073ee7b5621989d3a692125933`.

### estimateFeatureMapQualityForHosting:error:

```
- (https://developers.google.com/ar/reference/ios/group/GARFeatureMapQuality#garfeaturemapquality)estimateFeatureMapQualityForHosting:(simd_float4x4) transformerror:(NSError **) error
```
Estimates the quality of the visual features seen by ARCore in the preceding few seconds and visible from the provided camera transform.

Cloud Anchors hosted using higher quality features will generally result in easier and more accurately resolved Cloud Anchor transforms.


Details Parameters `transform` The camera transform to use in estimating the quality. `error` Out parameter for an `NSError`. Possible errors:

- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodenottracking` - bad current `ARTrackingState`.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeillegalstate` - current cloud anchor mode is disabled.
**Returns** The estimated quality of the visual features seen by ARCore in the preceding few seconds and visible from the provided camera transform. Provided by category `https://developers.google.com/ar/reference/ios/category/GARSession(CloudAnchors)#category_g_a_r_session_07_cloud_anchors_08_1a461f02d5d9f29e0c5449a39df0dfa767`.

### geospatialTransformFromTransform:error:

```
- (nullable https://developers.google.com/ar/reference/ios/interface/GARGeospatialTransform#interface_g_a_r_geospatial_transform *)geospatialTransformFromTransform:(matrix_float4x4) transformerror:(NSError **) error
```
Converts the provided transform to a `https://developers.google.com/ar/reference/ios/interface/GARGeospatialTransform#interface_g_a_r_geospatial_transform` with respect to the Earth.

Its heading will be zero for a `https://developers.google.com/ar/reference/ios/interface/GARGeospatialTransform#interface_g_a_r_geospatial_transform` returned from this method.


Details Parameters `transform` The local transform in world coordinate space. `error` Out param for an `NSError`. Possible error codes:

- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeillegalstate` - current Geospatial mode is disabled or earth has trackingState `https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstatestopped`.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodenottracking` - Earth's or Session's `ARTrackingState` is not `https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstatetracking`.
**Returns** `https://developers.google.com/ar/reference/ios/interface/GARGeospatialTransform#interface_g_a_r_geospatial_transform`, or `nil` if there was an error. Provided by category `https://developers.google.com/ar/reference/ios/category/GARSession(Geospatial)#category_g_a_r_session_07_geospatial_08_1a8f34a2bedb4a1b2a41fcbdb9d3358e0c`.

### hostCloudAnchor:TTLDays:completionHandler:error:

```
- (nullable https://developers.google.com/ar/reference/ios/interface/GARHostCloudAnchorFuture#interface_g_a_r_host_cloud_anchor_future *)hostCloudAnchor:(ARAnchor *) anchorTTLDays:(NSInteger) TTLDayscompletionHandler:(void(^)(NSString *_Nullable cloudIdentifier, https://developers.google.com/ar/reference/ios/group/GARCloudAnchorState#garcloudanchorstate cloudState)) completionHandlererror:(NSError **) error
```
Uses the transform and other data from `anchor` to host a new Cloud Anchor.

A Cloud Anchor is assigned an identifier that can be used to create an `https://developers.google.com/ar/reference/ios/interface/GARAnchor#interface_g_a_r_anchor` in the same position in subsequent sessions across devices using `https://developers.google.com/ar/reference/ios/category/GARSession(CloudAnchors)#resolvecloudanchorwithidentifier:completionhandler:error:`. See the [Cloud Anchors developer guide](https://developers.google.com/ar/develop/ios/cloud-anchors/developer-guide) for more information.

The duration that a Cloud Anchor can be resolved for is specified by `TTLDays`. When using [Token authorization](https://developers.google.com/ar/develop/ios/cloud-anchors/developer-guide#token-authorization), the maximum allowed value is 365 days. When using an [API Key](https://developers.google.com/ar/develop/ios/cloud-anchors/developer-guide#api-key-authorization) to authenticate with the ARCore API, the maximum allowed value is 1 day.

This launches an asynchronous operation used to query the Google Cloud ARCore API. See `https://developers.google.com/ar/reference/ios/interface/GARFuture#interface_g_a_r_future` for information on obtaining results and cancelling the operation.

Cloud Anchors requires a `https://developers.google.com/ar/reference/ios/interface/GARSessionConfiguration#interface_g_a_r_session_configuration` with `https://developers.google.com/ar/reference/ios/group/GARCloudAnchorMode#garcloudanchormodeenabled` set on this session. Use `https://developers.google.com/ar/reference/ios/category/GARSessionConfiguration(CloudAnchors)#cloudanchormode` to set the Cloud Anchor API mode and `https://developers.google.com/ar/reference/ios/interface/GARSession#setconfiguration:error:` to configure the session.

Hosting a Cloud Anchor works best when ARCore is able to create a good feature map around the `ARAnchor`. Use `https://developers.google.com/ar/reference/ios/category/GARSession(CloudAnchors)#estimatefeaturemapqualityforhosting:error:` to determine the quality of visual features seen by ARCore in the preceding few seconds. Cloud Anchors hosted using higher quality features will generally result in quicker and more accurately resolved Cloud Anchor transforms.

ARCore can have up to 40 simultaneous Cloud Anchor operations, including resolved anchors and active hosting operations.


Details Parameters `anchor` The `ARAnchor` with the desired transform to be used to create a hosted Cloud Anchor. `TTLDays` The lifetime of the anchor in days. Must be positive. `completionHandler` The completion block to execute on the Main thread when the operation is complete, unless the operation is cancelled. `error` Out parameter for an `NSError`. Possible errors:

- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeinvalidargument` - invalid (`nil`) anchor or invalid TTL.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodenottracking` - bad current `ARTrackingState`.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcoderesourceexhausted` - tried to create too many Cloud Anchors.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeillegalstate` - current `GARCloudAnchorMode` is disabled.
**Returns** A handle to the async operation that can be [polled](https://developers.google.com/ar/reference/ios/interface/GARFuture-1future#polling-a-future) or [cancelled](https://developers.google.com/ar/reference/ios/interface/GARFuture-1future#cancelling-a-future). Provided by category `https://developers.google.com/ar/reference/ios/category/GARSession(CloudAnchors)#category_g_a_r_session_07_cloud_anchors_08_1ac95b92ad1325c601d58530ddedb1e7cd`.

### hostCloudAnchor:TTLDays:error:

```
- (nullable https://developers.google.com/ar/reference/ios/interface/GARAnchor#interface_g_a_r_anchor *)hostCloudAnchor:(ARAnchor *) anchorTTLDays:(NSInteger) TTLDayserror:(NSError **) error
```
This will create a new Cloud Anchor with a given lifetime in days, using the transform of the provided anchor.

The cloud state of the returned anchor will be set to `https://developers.google.com/ar/reference/ios/group/GARCloudAnchorState#garcloudanchorstatetaskinprogress` and the initial transform will be set to the transform of the provided anchor. However, the returned anchor is completely independent of the original anchor, and the two transforms might diverge over time.

Hosting requires an active session for which the tracking state is `ARTrackingStateNormal`, as well as a working internet connection. ARCore will continue to retry silently in the background if it is unable to establish a connection to the ARCore API service.


Details Parameters `anchor` The `ARAnchor` with the desired transform to be used to create a hosted Cloud Anchor. `TTLDays` The lifetime of the anchor in days. Must be positive. The maximum allowed value is 1 if using an API Key to authenticate with the ARCore API service, otherwise the maximum allowed value is 365. `error` Out parameter for an `NSError`. Possible errors:

- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeinvalidargument` - invalid (`nil`) anchor or invalid TTL.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodenottracking` - bad current `ARTrackingState`.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcoderesourceexhausted` - tried to create too many Cloud Anchors.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeillegalstate` - current cloud anchor mode is disabled.
**Returns** The new `https://developers.google.com/ar/reference/ios/interface/GARAnchor#interface_g_a_r_anchor`, or `nil` if there is an error. Provided by category `https://developers.google.com/ar/reference/ios/category/GARSession(CloudAnchors)#category_g_a_r_session_07_cloud_anchors_08_1a398fd05cd3fe9948d6345fce4d2fb42d`.

### hostCloudAnchor:error:

```
- (nullable https://developers.google.com/ar/reference/ios/interface/GARAnchor#interface_g_a_r_anchor *)hostCloudAnchor:(ARAnchor *) anchorerror:(NSError **) error
```
Hosts a new Cloud Anchor based on an `ARAnchor`.

The new anchor will have a cloud state of `https://developers.google.com/ar/reference/ios/group/GARCloudAnchorState#garcloudanchorstatetaskinprogress` and its initial transform will be set to that of the passed-in anchor. However, the two transforms may differ over time.


Details Parameters `anchor` The `ARAnchor` to host. `error` Out parameter for an `NSError`. Possible errors:

- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeinvalidargument` - invalid (`nil`) anchor.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodenottracking` - bad current `ARTrackingState`.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcoderesourceexhausted` - tried to create too many Cloud Anchors.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeillegalstate` - current cloud anchor mode is disabled.
**Returns** The new `https://developers.google.com/ar/reference/ios/interface/GARAnchor#interface_g_a_r_anchor`, or `nil` if there is an error. Provided by category `https://developers.google.com/ar/reference/ios/category/GARSession(CloudAnchors)#category_g_a_r_session_07_cloud_anchors_08_1ad54c2dbe2f79fc0d24cd3dc85a46a510`.

### isGeospatialModeSupported:

```
- (BOOL)isGeospatialModeSupported:(https://developers.google.com/ar/reference/ios/group/GARGeospatialMode#gargeospatialmode) geospatialMode
```
Determines whether the given geospatial mode is supported on the current device and OS version.

If this returns NO, then configuring the session with the given geospatial mode will fail with the error code `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeconfigurationnotsupported`. A device may be incompatible with a given mode due to insufficient sensor capabilities.


Details Parameters `geospatialMode` The Geospatial mode. **Returns** YES if the `geospatialMode` is supported, NO otherwise. Provided by category `https://developers.google.com/ar/reference/ios/category/GARSession(Geospatial)#category_g_a_r_session_07_geospatial_08_1ae0bdf3c3c987a5c3df8914c6fcd3c5a6`.

### isSemanticModeSupported:

```
- (BOOL)isSemanticModeSupported:(https://developers.google.com/ar/reference/ios/group/GARSemanticMode#garsemanticmode) semanticMode
```
Determines whether the given `https://developers.google.com/ar/reference/ios/group/GARSemanticMode#garsemanticmode` is supported on the current device and OS version.

If this returns `NO`, then using `https://developers.google.com/ar/reference/ios/interface/GARSession#setconfiguration:error:` with the given semantic mode will fail with the error code `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeconfigurationnotsupported`. A device may be incompatible with a given mode due to insufficient sensor capabilities or compute performance.


Details Parameters `semanticMode` The Scene Semantics mode. **Returns** `YES` if the `semanticMode` is supported, `NO` otherwise. Provided by category `https://developers.google.com/ar/reference/ios/category/GARSession(Semantics)#category_g_a_r_session_07_semantics_08_1a53d3e43a967121d5b698bef51ddb7fd1`.

### raycastStreetscapeGeometry:direction:error:

```
- (nullable NSArray< https://developers.google.com/ar/reference/ios/interface/GARStreetscapeGeometryRaycastResult#interface_g_a_r_streetscape_geometry_raycast_result * > *)raycastStreetscapeGeometry:(simd_float3) origindirection:(simd_float3) directionerror:(NSError **) error
```
Performs a raycast against Streetscape Geometry loaded by the scene.

The raycast result contains the transform of the hit as well as the `https://developers.google.com/ar/reference/ios/interface/GARStreetscapeGeometry#interface_g_a_r_streetscape_geometry` that was hit.

Requires both `https://developers.google.com/ar/reference/ios/category/GARSessionConfiguration(Geospatial)#streetscapegeometrymode` to be set to `https://developers.google.com/ar/reference/ios/group/GARStreetscapeGeometryMode#garstreetscapegeometrymodeenabled` and for `https://developers.google.com/ar/reference/ios/category/GARSessionConfiguration(Geospatial)#geospatialmode` to be set to `https://developers.google.com/ar/reference/ios/group/GARGeospatialMode#gargeospatialmodeenabled`.


Details Parameters `origin` World space origin of the ray. `direction` World space direction of the ray. `error` Out param for an `NSError`. Possible error codes:

- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeillegalstate` - current geospatial mode is disabled, or Streetscape Geometry mode is disabled, or earth has trackingState `https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstatestopped`.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodenottracking` - Earth, Session, or the geometry's tracking state is not `https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstatetracking`.
**Returns** The list of raycast hits, or `nil` if there was an error. Provided by category `https://developers.google.com/ar/reference/ios/category/GARSession(Geospatial)#category_g_a_r_session_07_geospatial_08_1a79f0cefef3296f54fdc1e44d7cbecff4`.

### removeAnchor:

```
- (void)removeAnchor:(https://developers.google.com/ar/reference/ios/interface/GARAnchor#interface_g_a_r_anchor *) anchor
```
Removes an anchor from the session.


Details Parameters `anchor` The anchor to remove.

### resolveCloudAnchorWithIdentifier:completionHandler:error:

```
- (nullable https://developers.google.com/ar/reference/ios/interface/GARResolveCloudAnchorFuture#interface_g_a_r_resolve_cloud_anchor_future *)resolveCloudAnchorWithIdentifier:(NSString *) identifiercompletionHandler:(void(^)(https://developers.google.com/ar/reference/ios/interface/GARAnchor#interface_g_a_r_anchor *_Nullable anchor, https://developers.google.com/ar/reference/ios/group/GARCloudAnchorState#garcloudanchorstate cloudState)) completionHandlererror:(NSError **) error
```
Attempts to resolve a Cloud Anchor using the provided `identifier`.

The Cloud Anchor must previously have been hosted by `https://developers.google.com/ar/reference/ios/category/GARSession(CloudAnchors)#hostcloudanchor:ttldays:completionhandler:error:` or another Cloud Anchor hosting method within the allotted `TTLDays`. See the [Cloud Anchors developer guide](https://developers.google.com/ar/develop/ios/cloud-anchors/developer-guide) for more information.

This launches an asynchronous operation used to query the Google Cloud ARCore API. See `https://developers.google.com/ar/reference/ios/interface/GARFuture#interface_g_a_r_future` for information on obtaining results and cancelling the operation.

When resolving a Cloud Anchor, the ARCore API periodically compares visual features from the scene against the anchor's 3D feature map to pinpoint the user's position and orientation relative to the anchor. When it finds a match, the task completes.

Cloud Anchors requires a `https://developers.google.com/ar/reference/ios/interface/GARSessionConfiguration#interface_g_a_r_session_configuration` with `https://developers.google.com/ar/reference/ios/group/GARCloudAnchorMode#garcloudanchormodeenabled` set on this session. Use `https://developers.google.com/ar/reference/ios/category/GARSessionConfiguration(CloudAnchors)#cloudanchormode` to set the Cloud Anchor API mode and `https://developers.google.com/ar/reference/ios/interface/GARSession#setconfiguration:error:` to configure the session.

ARCore can have up to 40 simultaneous Cloud Anchor operations, including resolved anchors and active hosting operations.


Details Parameters `identifier` The Cloud Anchor identifier for the anchor. `completionHandler` [Completion handler](https://developers.google.com/ar/reference/ios/interface/GARFuture-1future#using-a-completion-handler-to-obtain-future-results) to be invoked on the Main thread, if not `nil`. `error` Out parameter for an `NSError`. Possible errors:

- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeinvalidargument` - invalid (`nil` or empty) identifier.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcoderesourceexhausted` - tried to create too many Cloud Anchors.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeillegalstate` - current `GARCloudAnchorMode` is disabled.
**Returns** A handle to the async operation that can be [polled](https://developers.google.com/ar/reference/ios/interface/GARFuture-1future#polling-a-future) or [cancelled](https://developers.google.com/ar/reference/ios/interface/GARFuture-1future#cancelling-a-future). Provided by category `https://developers.google.com/ar/reference/ios/category/GARSession(CloudAnchors)#category_g_a_r_session_07_cloud_anchors_08_1a1710748b3c6b9915d5c27c834c382fb9`.

### resolveCloudAnchorWithIdentifier:error:

```
- (nullable https://developers.google.com/ar/reference/ios/interface/GARAnchor#interface_g_a_r_anchor *)resolveCloudAnchorWithIdentifier:(NSString *) identifiererror:(NSError **) error
```
Resolves a Cloud Anchor with a given identifier.

The new anchor is immediately added to the session and returned, but without a valid transform. You don't need to wait for a call to resolve a Cloud Anchor to complete before initiating another call. A session can be resolving up to 40 Cloud Anchors at a given time. If resolving fails, the anchor will be automatically removed from the session.


Details Parameters `identifier` The Cloud Anchor identifier for the anchor. `error` Out parameter for an `NSError`. Possible errors:

- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeinvalidargument` - invalid (`nil` or empty) identifier.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcoderesourceexhausted` - tried to create too many Cloud Anchors.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeillegalstate` - current cloud anchor mode is disabled.
**Returns** The new `https://developers.google.com/ar/reference/ios/interface/GARAnchor#interface_g_a_r_anchor`, or `nil` if there is an error. Provided by category `https://developers.google.com/ar/reference/ios/category/GARSession(CloudAnchors)#category_g_a_r_session_07_cloud_anchors_08_1a14cf03b41b679f3c06b8c2ac812cfcb3`.

### setAuthToken:

```
- (void)setAuthToken:(NSString *) authToken
```
Provide an auth token to use when authenticating with Google Cloud Services.

If the session was created with an API Key, the token will be ignored and an error will be logged. Otherwise, the most recent valid auth token passed in will be used. Call this method each time you refresh your token.


Details Parameters `authToken` Token to use when authenticating with Google Cloud Services. This must be a nonempty ASCII string with no spaces or control characters. This will be used until another token is passed in. See documentation for supported token types.

### setConfiguration:error:

```
- (void)setConfiguration:(https://developers.google.com/ar/reference/ios/interface/GARSessionConfiguration#interface_g_a_r_session_configuration *) configurationerror:(NSError **) error
```
Sets the configuration for the session.


Details Parameters `configuration` The new configuration to use. `error` Out param for an `NSError`.

### transformFromGeospatialCoordinate:altitude:eastUpSouthQTarget:error:

```
- (matrix_float4x4)transformFromGeospatialCoordinate:(CLLocationCoordinate2D) coordinatealtitude:(CLLocationDistance) altitudeeastUpSouthQTarget:(simd_quatf) eastUpSouthQTargeterror:(NSError **) error
```
Converts the provided Earth specified horizontal position, altitude and rotation with respect to an east-up-south coordinate frame to a local transform in world coordinate space.


Details Parameters `coordinate` The latitude and longitude associated with the location, specified using the WGS84 reference frame. This must not be within .1° of the North or South pole (i.e. +- 90°). `altitude` Altitude in reference to the WGS 84 ellipsoid, in meters. Positive values indicate altitudes above approximate sea level. Negative values indicate altitudes below approximate sea level. `eastUpSouthQTarget` Represents the quaternion from the target to East-Up-South (EUS) coordinates (i.e., +X points East, +Y points up, and +Z points South). `error` Out param for an `NSError`. Possible error codes:

- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeillegalstate` - current Geospatial mode is disabled or earth has trackingState `https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstatestopped`.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodenottracking` - Earth's or Session's `ARTrackingState` is not `https://developers.google.com/ar/reference/ios/group/GARTrackingState#gartrackingstatetracking`.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeinvalidargument` - latitude is not within range.
**Returns** a local transform in world coordinate space. Provided by category `https://developers.google.com/ar/reference/ios/category/GARSession(Geospatial)#category_g_a_r_session_07_geospatial_08_1a822bc1ce5bb3c1963568fb6c8cc9207c`.

### update:error:

```
- (nullable https://developers.google.com/ar/reference/ios/interface/GARFrame#interface_g_a_r_frame *)update:(ARFrame *) frameerror:(NSError **) error
```
Updates the `https://developers.google.com/ar/reference/ios/interface/GARSession#interface_g_a_r_session` with an `ARFrame`.

Call this method with every `ARFrame` to keep the sessions synced. Can be called on any thread. Normally, this should be called from your `ARSessionDelegate`'s `session:didUpdateFrame:` method.


Details Parameters `frame` The next `ARFrame` from **ARKit**. `error` Out parameter for `NSError`. Possible errors:

- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeinvalidargument` - invalid (`nil`) frame.
- `https://developers.google.com/ar/reference/ios/group/GARSessionErrorCode#garsessionerrorcodeframeoutoforder` - frame has a smaller timestamp than previous.
**Returns** The `https://developers.google.com/ar/reference/ios/interface/GARFrame#interface_g_a_r_frame` corresponding to the `ARFrame` passed in, or `nil` if there is an error.