docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Session

    This page is a supplement to the AR Foundation Session manual. The following sections only contain information about APIs where ARKit exhibits unique platform-specific behavior.

    Tip

    When developing an AR app, refer to both the AR Foundation documentation as well as the required packages for each platform you support.

    Optional feature support

    ARKit implements the following optional features of AR Foundation's XRSessionSubsystem:

    Feature Descriptor Property Supported
    Install supportsInstall
    Match frame rate supportsMatchFrameRate Yes
    Note

    Refer to AR Foundation Session platform support for more information on the optional features of the session subsystem.

    Check if AR is supported

    ARKit implements XRSessionSubsystem.GetAvailabilityAsync, which consists of the device checking that it's running on iOS 11.0 or newer.

    Native pointer

    XRSessionSubsystem.nativePtr values returned by this package contain a pointer to the following struct:

    typedef struct UnityXRNativeSession
    {
        int version;
        void* sessionPtr;
    } UnityXRNativeSession;
    

    This package also provides a header file containing the definitions of various native data structs including UnityXRNativeSession. It can be found in the package directory under Includes~/UnityXRNativePtrs.h.

    Cast void* sessionPtr to an ArSession handle in Objective C using the following example code:

    // Marshal the native session data from the XRSessionSubsystem.nativePtr in C#
    UnityXRNativeSession nativeSessionData;
    ArSession* session = static_cast<ArSession*>(nativeSessionData.sessionPtr);
    

    To learn more about native pointers and their usage, refer to Extending AR Foundation.


    Apple and ARKit are trademarks of Apple Inc., registered in the U.S. and other countries and regions.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)