Configure an ARCore session in iOS
Stay organized with collections
Save and categorize content based on your preferences.
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:
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 session in iOS
Next steps
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 2024-10-31 UTC.
[null,null,["Last updated 2024-10-31 UTC."],[[["\u003cp\u003eAn ARCore session, represented by \u003ccode\u003eGARSession\u003c/code\u003e, manages all AR processes like motion tracking and environmental understanding.\u003c/p\u003e\n"],["\u003cp\u003eYou can configure a session to use features such as Cloud Anchors, Augmented Faces, and the ARCore Geospatial API.\u003c/p\u003e\n"],["\u003cp\u003eTo create a session in iOS, you need to initialize \u003ccode\u003eGARSession\u003c/code\u003e, set delegates for callbacks, and integrate with ARKit's \u003ccode\u003eARSession\u003c/code\u003e for frame processing.\u003c/p\u003e\n"],["\u003cp\u003eSession configuration allows enabling specific features like Cloud Anchors or the Geospatial API by setting properties on \u003ccode\u003eGARSessionConfiguration\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Configure an ARCore session in iOS\n\nConfigure an ARCore session to build AR experiences for your app.\n\nWhat is a session?\n------------------\n\nAll [AR processes](/ar/discover/concepts), such as motion tracking,\nenvironmental understanding, and lighting estimation, happen inside an ARCore\nsession. [`GARSession`](/ar/reference/ios/interface_g_a_r_session) is the main entry point to the ARCore\nAPI. It manages the AR system state and handles the session lifecycle, allowing\nthe app to create, configure, start, or stop a session. Most importantly, it\nenables the app to receive frames that allow access to the camera image and\ndevice pose.\n\nThe session can be used to configure the following features:\n\n- [Cloud Anchors](/ar/develop/cloud-anchors)\n- [Augmented Faces](/ar/develop/augmented-faces)\n- [ARCore Geospatial API](/ar/develop/geospatial)\n\nConfigure a session\n-------------------\n\nTo use either the [Cloud Anchors](/ar/develop/cloud-anchors) API or the\n[Geospatial](/ar/develop/geospatial) API, you have to create a\n[GARSessionConfiguration](/ar/reference/ios/interface_g_a_r_session_configuration)\nwith either the `cloudAnchorMode` or `geospatialMode` property:\n\n- create a\n [`GARSessionConfiguration`](/ar/reference/ios/interface_g_a_r_session_configuration)\n and set the `geospatialMode` or `cloudAnchorMode` property for it.\n\n- Use\n [`setConfiguration:error: (GARSession)`](/ar/reference/ios/interface_g_a_r_session#aa30bf763b9b1006371f6c93294bd76f5)\n to set the configuration.\n\nCreate a session in iOS\n-----------------------\n\n- Create a [`GARSession`](/ar/reference/ios/interface_g_a_r_session).\n- Set a [`GARSessionDelegate`](/ar/reference/ios/protocol_g_a_r_session_delegate-p) to get callbacks from hosting and resolving operations.\n- Create and run an [`ARSession`](https://developer.apple.com/documentation/arkit/arsession).\n- Set an [`ARSessionDelegate`](https://developer.apple.com/documentation/arkit/arsession/2865614-delegate).\n- Pass [`ARFrame`s](https://developer.apple.com/documentation/arkit/arframe) to the `GARSession` in the `session:didUpdateFrame:` method.\n\nNext steps\n----------\n\n- [Cloud Anchors for iOS](/ar/develop/ios/cloud-anchors/overview)\n- [Augmented Faces for iOS](/ar/develop/ios/augmented-faces/overview)\n- [ARCore Geospatial API](/ar/develop/geospatial)"]]