visionOS Project Configuration

Apply to Apple Inc. for Enterprise API Entitlement

Attention

Please refer Building spatial experiences for business apps with enterprise APIs for visionOS to apply to Apple Inc. for the entitlement of the Enterprise App Camera API and obtain a license. (Please notice that this License is distributed by Apple Inc., it is not the same thing with EasyAR License).

Notice: The bundle ID used to create EasyAR Sense License Key and the Bundle ID specified in the Enterprise entitlement should be same.

Environment

  • visionOS 2.0 or later

  • Xcode 16.0 or later (compatible with the corresponding visionOS version) with visionOS simulator

  • Recommended Unity versions: 6000.0.23+

Unity visionOS App Mode

There are 4 app modes when using Unity on visionOS, which

App modes supprted by EasyAR include,
  • Metal Rendering with Compositor Services

  • RealityKit with PolySpatial

  • Hybrid - Switch Between Metal and RealityKit

App modes not supprted by EasyAR include,
  • Windowed - 2D Window

../_images/image_g11_17.png

Please read Unity offcial documents for the differences and usage variance.

Install Unity Plugins

Unity plugins that are needed to install includes:

Unity 6+

App Mode = Metal:
  • com.unity.xr.visionos (2.0.4+)

App Mode = RealityKit/Hybrid:
  • com.unity.xr.visionos (2.0.4+)

  • com.unity.polyspatial (2.0.4+)

  • com.unity.polyspatial.visionos (2.0.4+)

  • com.unity.polyspatial.xr (2.0.4+)

The version numbers must be the same for all above plugins.

Unity 2023+

Some early releases of Unity 2023.x do not support building visionOS packages. Please use Unity 6.

Unity 2022.3.19+

App Mode = Metal:
  • com.unity.xr.visionos (1.2.3)

App Mode = RealityKit/Hybrid:
  • com.unity.xr.visionos (1.2.3)

  • com.unity.polyspatial (1.2.3)

  • com.unity.polyspatial.visionos (1.2.3)

  • com.unity.polyspatial.xr (1.2.3)

The version numbers must be the same for all above plugins.

Attention

Please do not use version 1.3.x. Version 1.3.x has been verified to have conflicts and not usable.


Build Platform Configuration

Switch Build Platform to visionOS:

../_images/image_g11_1.png

Input System Configuration

Edit > Project Settings > Player

  • Set Active Input Handling to Input System Package(New)

../_images/image_g11_6.png

Unity will then prompt you to restart the project. Click Apply to activate the changes.

../_images/image_g11_5.png

XR Plug-in Management Configuration

Edit > Project Settings > XR Plug-in Management

  • Plug-in Providers check Apple visionOS

../_images/image_g11_3.png

Edit > Project Settings > XR Plug-in Management > Apple visionOS

  • Select EasyAR supported App Mode according to your needs

../_images/image_g11_17.png
  • Add World Sensing Usage Description

  • Set Metal Immersion Style to Mixed

  • Set Reality Kit Immersion Style to Mixed

  • Check IL2CPP Large Exe Workaround

../_images/image_g11_4.png

PolySpatial Configuration

Note

Config if app mode is RealityKit or Hybrid.

Edit > Project Settings > PolySpatial

  • Set Default Volume Camera Window Config to Default Unbounded Configuration

  • Check Auto-Create Volume Camera

../_images/image_g11_2.png

If you need custom Default Volume Camera Window Config, make sure to set its Mode to Unbounded

../_images/image_g11_19.png

Delete Volume Camera in the scene (if it exist)

../_images/image_g11_20.png
  • Delete Volume Camera in the scene if it exist.

  • (not recomannded) If you need a a unique custom Volume Camera, please set its World Transform to identity, and make sure Mode of its Volume Camera Window Configuration is set to Unbounded. Please refer to the relevant Unity documentations and use it only when you fully understand its purpose and implications.

  • Volume Camera with non-identity World Transform is not supported.

Attention

Make sure to confirm there is NO Volume Camera in the scene or setup according to above description.

TextMesh Pro Configuration

Note

Config if app mode is RealityKit or Hybrid.

Edit > ProjectSettings > TextMesh Pro

  • Click Import TMP Essentials

../_images/image_g11_7.png

Note

RealityKit with PolySpatial currently only supports TextMesh Pro for rendering text.


Bundle ID

Set visionOS Bundle ID in Player Settings. Bundle ID should be same with the one when creating License Key and should be consistent with the Bundle ID specified in the Enterprise entitlement applied to Apple

../_images/image_g11_8.png

A window will popup if the License Key is invalid (e.g. when bundle id is not matched)

../_images/image_g11_9.png

The application will fail to work if you continue to build when this window shows. Please check and fix problems according to messages in the window.

In some special situation when you want to initialize EasyAR manually using scripts, you do not use the license key in the Settings asset. In this case, you can choose Continue and don't warn me again , or disable Verify License When Build option to disable verification in the build process.

../_images/image_g11_10.png

Permissions

You can check permissions used by EasyAR, make sure to turn permissions on for the features you are using. These options are used to check if Usage Descriptions are filled, and break the build if necessary. If you need to set Usage Descriptions in XCode and not in Unity, you can just turn them off.

../_images/image_g11_11.png
  • Camera Device: Cancel selection. Camera permission for visionOS is not been granted in Unity. So there is no need to perform a check.

  • Video Recording: Cancel selection. VideoRecorder is not supported on VisionOS.

  • Mega: Permission required for MegaTrackerFrameFilter. Turn on this option will use Location permission on device (ONLY when com.easyar.mega package exist).

Add Location Usage Description if Mega is on and com.easyar.mega package exist, or the build will fail.

Note

Unity currently only has the Location Usage Description field in the PlayerSettings for iOS. The Location Usage Description field set in iOS PlayerSettings is also effective in VisionOS.

../_images/image_g11_12.png ../_images/image_g11_13.png

Camera Permissions (XCode Project)

Generate XCode project with Unity, then in the Signing & Capabilities page, click +Capability, add Main Camera Access

../_images/image_g11_15.png

Note

This item will not appear if the enterprise entitlement has not been successfully applied.

Copy the obtained Enterprise.license file to the XCode project directory and add it to the XCode project.

../_images/image_g11_16.png

EIF Default Path Read Permission (XCode Project)

If you need to record EIF and send it to a computer or other device via the Files app on Vision Pro, you need to add the following fields to the Info.plist,

  • Add LSSupportsOpeningDocumentsInPlace and set its value to true

  • Add UIFileSharingEnabled and set its value to true

Note

It is normal that the displayed text is not the same as you insert to the plist.

../_images/image_g11_18.png