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
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
:
Input System Configuration¶
Edit > Project Settings > Player
Set
Active Input Handling
toInput System Package(New)
Unity will then prompt you to restart the project. Click Apply
to activate the changes.
XR Plug-in Management Configuration¶
Edit > Project Settings > XR Plug-in Management
Plug-in Providers check
Apple visionOS
Edit > Project Settings > XR Plug-in Management > Apple visionOS
Select EasyAR supported
App Mode
according to your needs
Add
World Sensing Usage Description
Set
Metal Immersion Style
toMixed
Set
Reality Kit Immersion Style
toMixed
Check
IL2CPP Large Exe Workaround
PolySpatial Configuration¶
Note
Config if app mode is RealityKit or Hybrid.
Edit > Project Settings > PolySpatial
Set
Default Volume Camera Window Config
toDefault Unbounded Configuration
Check
Auto-Create Volume Camera
If you need custom Default Volume Camera Window Config
, make sure to set its Mode
to Unbounded
Delete Volume Camera
in the scene (if it exist)
Delete
Volume Camera
in the scene if it exist.(not recomannded) If you need a a unique custom
Volume Camera
, please set itsWorld Transform
toidentity
, and make sureMode
of itsVolume Camera Window Configuration
is set toUnbounded
. Please refer to the relevant Unity documentations and use it only when you fully understand its purpose and implications.Volume Camera
withnon-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
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
A window will popup if the License Key is invalid (e.g. when bundle id is not matched)
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.
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.
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.
Camera Permissions (XCode Project)¶
Generate XCode project with Unity, then in the Signing & Capabilities
page, click +Capability
, add Main Camera Access
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.
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 totrue
Add
UIFileSharingEnabled
and set its value totrue
Note
It is normal that the displayed text is not the same as you insert to the plist.