Check VPS availability at the device's current location

Stay organized with collections Save and categorize content based on your preferences.

The Geospatial API uses a combination of VPS and GPS data to generate high-accuracy Geospatial transforms. The API can be used in any place where the device is able to determine its location:

  • In areas with low GPS accuracy, such as indoor spaces and dense urban environments, the API will rely on VPS coverage to generate high-accuracy transforms.
  • In outdoor environments with few or no overhead obstructions, the Geospatial API may be able to use available GPS location data to generate Geospatial transforms with high accuracy.

You can determine VPS availability at a given horizontal position before the AR session starts and use it to create more specific experiences — for example, to present an "Enter AR" button only when VPS is available.

Enable the ARCore API

Your app must enable the ARCore API to check VPS availability.

Check VPS availability in your app

The Geospatial API can be used in any place where the device is able to determine its location. If your AR experience hinges on VPS coverage, you can use GARSession.checkVPSAvailabilityAtCoordinate:completionHandler: to obtain a GARVPSAvailabilityFuture, an asynchronous task that checks the VPS availability at a given horizontal position. Once you have the GARVPSAvailabilityFuture, you can obtain its result by polling or through a callback.

Poll the result

Use GARVPSAvailabilityFuture.state to obtain the state of the GARVPSAvailabilityFuture. There are three different states:

You may continue checking GARVPSAvailabilityFuture.state and GARVPSAvailabilityFuture.result until the task is complete.

Obtain the result through a callback

You can also obtain the result of a GARVPSAvailabilityFuture through a callback. Use GARSession.checkVPSAvailabilityAtCoordinate:completionHandler: and supply a completionHandler. This completionHandler will be called on the Main thread soon after the GARVPSAvailabilityFuture has state GARFutureStateDone.

Cancel the GARVPSAvailabilityFuture

Use GARVPSAvailabilityFuture.cancel to attempt to cancel the GARVPSAvailabilityFuture. Due to thread parallelism, it may be possible that your cancel attempt will not go through. GARVPSAvailabilityFuture.cancel returns YES if this attempt was successful, and NO otherwise.

Use the Geospatial API without VPS coverage

The Geospatial API can also be used in areas that do not have VPS coverage. In outdoor environments with few or no overhead obstructions, GPS may be sufficient to generate a pose with high accuracy.

What's next