We have introduced a new spatial data runtime permission that allows users to control which app can access their spatial data. The permission applies to apps running on Quest 2, Quest Pro, and Quest 3. See Requesting runtime permissions for more information.
An app that wants to use Scene Model or Depth data needs to request spatial data permission during the app’s runtime. The request will display a one-time permission explainer dialog, followed by a permission consent confirmation dialog. Only when the permission is granted by the users can the apps query all spatial data on the user’s device.
Devices
Accessing spatial data through the new permission flow is effective on Quest 2, Quest Pro, and Quest 3.
Link
Meta Horizon Link v62 introduced a new permission toggle to control the access of the spatial data. Developers need to toggle it on to get access to the spatial data when querying for anchors or using the Depth API on the device. To toggle it on, navigate to Settings and toggle on Spatial Data over Meta Horizon Link.
Declare the permission
In order for the headset to know that the permission is used by the app, it needs to be specified in the app’s Android manifest. In your app’s AndroidManifest.xml, declare the following permission:
<uses-permission android:name="com.oculus.permission.USE_SCENE" />
Alternatively this can be done in the Edit > Project Settings... go to the section Plugins > Meta XR then enable Mobile > Scene Support.
When to request the permission
As per the Android permission guidelines, it is recommended to request the permission only when using the functionality, and to provide a fallback if the user decides not to grant the permission.
You can use the following code to first check if the permission has been already granted, and if not, request the permission, at the custom timing you want. You will also need to add bSceneSupportEnabled=True into your project settings in DefaultEngine.ini.
If the app is compiled with the current versions of the SDK, there is no requirement to request the permission in the app. The system will automatically show a permission dialog when the app is launched.
If permission is not granted by the user, the Scene Actor will not be populated with the scene entity actors, even if there is spatial data captured on user’s device.