Session platform support
Understand the features of the session subsystem, and which platforms support these features.
AR Foundation requires that all provider implementations on all platforms support the session feature, as shown in the following table:
| Provider plug-in | Session supported | Provider documentation |
|---|---|---|
| Google ARCore XR Plug-in | Yes | Session (ARCore) |
| Apple ARKit XR Plug-in | Yes | Session (ARKit) |
| Apple visionOS XR Plug-in | Yes | N/A |
| Unity OpenXR: Meta | Yes | Session (Meta OpenXR) |
| Unity OpenXR: Android XR | Yes | Session (Android XR) |
| XR Simulation | Yes | Session (XR Simulation) |
Optional features
The following table lists the optional features of the session subsystem. Each optional feature is defined by a Descriptor Property of the XRSessionSubsystemDescriptor, which you can check at runtime to determine whether your target platform supports a feature. Refer to Check for optional feature support for a code example to check whether a feature is supported.
| Feature | Descriptor Property | Description |
|---|---|---|
| Install (Deprecated) | supportsInstall | Whether the session supports the update or installation of session software. |
| Match frame rate | supportsMatchFrameRate | Whether the session supports matching the AR frame rate to the Unity frame rate. |
Optional feature platform support
The following table lists whether certain XR plug-in providers support each optional feature:
| Feature | ARCore | ARKit | visionOS | Meta OpenXR | Android XR | XR Simulation |
|---|---|---|---|---|---|---|
| Install (Deprecated) | Yes | |||||
| Match frame rate | Yes | Yes |
Check for optional feature support
Your app can check at runtime whether a session provider supports any optional features on the user's device. The XRSessionSubsystemDescriptor contains Boolean properties for each optional feature that tell you whether they're supported.
Refer to the following example code to learn how to check for optional feature support:
void CheckForOptionalFeatureSupport(ARSession manager)
{
// Use manager.descriptor to determine which optional features
// are supported on the device. For example:
if (manager.descriptor.supportsMatchFrameRate)
{
// Match frame rate is supported.
}
}
AR support on mobile devices
Some mobile devices require additional software to run AR. You can request the device to install or update necessary XR software. You can learn more about AR support on mobile devices, by referring to the ARCore and ARKit documentation.
Refer to the following section to install XR software on your target device if required.
Install XR software on mobile devices
To attempt to install XR software, pass InstallSoftwareIfNeeded to TryStartAsync.
When AR isn't supported on the device, TryStartAsync returns an XRResultStatus with a StatusCode.Unsupported status code, which you can check to provide an alternative experience.
The following example installs required software if needed, starts the session, and handles an unsupported device:
async Awaitable InstallAndStartSession(XRSessionSubsystem sessionSubsystem, CancellationToken cancellationToken)
{
// Pass InstallSoftwareIfNeeded so the subsystem checks for, and installs,
// any required AR software before it starts.
var result = await sessionSubsystem.TryStartAsync(
cancellationToken, XRSubsystemStartOptions.InstallSoftwareIfNeeded);
if (result.statusCode == XRResultStatus.StatusCode.Unsupported)
{
// AR is not supported on this device. Start a fallback (non-AR) experience instead.
return;
}
if (result.IsError())
{
// AR is supported, but the required software could not be installed
// (for example, the user declined the installation).
return;
}
// The session started successfully and AR is now running.
}
Apple and ARKit are trademarks of Apple Inc., registered in the U.S. and other countries and regions.