AI-generated Key Takeaways
-
An ARCore session, represented by
GARSession
, manages all AR processes like motion tracking and environmental understanding. -
You can configure a session to use features such as Cloud Anchors, Augmented Faces, and the ARCore Geospatial API.
-
To create a session in iOS, you need to initialize
GARSession
, set delegates for callbacks, and integrate with ARKit'sARSession
for frame processing. -
Session configuration allows enabling specific features like Cloud Anchors or the Geospatial API by setting properties on
GARSessionConfiguration
.
Configure an ARCore session to build AR experiences for your app.
What is a session?
All AR processes, such as motion tracking,
environmental understanding, and lighting estimation, happen inside an ARCore
session. GARSession
is the main entry point to the ARCore
API. It manages the AR system state and handles the session lifecycle, allowing
the app to create, configure, start, or stop a session. Most importantly, it
enables the app to receive frames that allow access to the camera image and
device pose.
The session can be used to configure the following features:
Configure a session
To use either the Cloud Anchors API or the
Geospatial API, you have to create a
GARSessionConfiguration
with either the cloudAnchorMode
or geospatialMode
property:
create a
GARSessionConfiguration
and set thegeospatialMode
orcloudAnchorMode
property for it.Use
setConfiguration:error: (GARSession)
to set the configuration.
Create a session in iOS
- Create a
GARSession
. - Set a
GARSessionDelegate
to get callbacks from hosting and resolving operations. - Create and run an
ARSession
. - Set an
ARSessionDelegate
. - Pass
ARFrame
s to theGARSession
in thesession:didUpdateFrame:
method.