How to reduce the number of permissions(motion sensors, motion and orientations) prompt in three.js

When I implement object placement using 8thwall, the following 3 prompt popups.
“Access Motion and Orientation”
“assess to device motions sensors”
“assess to camera”
Is there a way to show one camera access popup and automatically enable other motion sensors?

I am using the following pipeline modules.

this.XR8.GlTextureRenderer.pipelineModule(),
this.XR8.Threejs.pipelineModule(),
this.XR8.XrController.pipelineModule(),
this.XR8.FullWindowCanvas.pipelineModule(),
this.XRExtras.AlmostThere.pipelineModule(),
this.XRExtras.Loading.pipelineModule(),
this.XRExtras.RuntimeError.pipelineModule(),
myCustomizedPipelineModule()

Hello! Unfortunately iOS doesn’t allow you to combine these prompts, however depending on the type of AR experience you are creating and the sensors it requires, some may not be needed.

Here are the prompts you’ll generally see for experiences that require gyro (WorldEffects/SLAM, VPS, Sky Effects, etc):

Prompt 1: “AR requires access to device motion sensors” - this pre-permission-prompt comes from the 8th Wall engine, and is only injected if needed:

The above prompt’s text and look can be customized using CSS and/or Mutation observers.

Prompt 2: Motion and Orientation (gyro) actual permission prompt, coming directly from the browser (cannot customize):

Prompt 3: Camera permission prompt, coming directly from the browser (cannot customize):

Apple has decided that a user gesture, such as a tap, must first be captured before gyro permissions (Prompt 2) can be requested. This is an Apple/iOS limitation/requirement, not 8th Wall.

As a result, if our engine detects that a user gesture hasn’t yet been captured when it starts, it will inject Prompt 1 to encourage the user to tap the screen so the real gyro permission prompt (Prompt 2) can be requested.

Now, if you start the engine through a user gesture, such as calling XR8.run() (or for AFrame projects add the xrweb component to your scene) in a click event handler on a button then Prompt 1 won’t be injected.

Sample project: Splash Screen | 8th Wall Playground | 8th Wall

In this case, you’ll only see Prompt 2 and Prompt 3. But ultimately the user still needs to tap 3 times during the initialization process.

If you are creating an experience that doesn’t require gyro (Image Target only by setting disableWorldTracking: true, where gyro isn’t needed, then you’d only see the camera permission request (Prompt3)

Also note, if you require location permissions (GPS) that will also be a separate prompt coming from iOS browsers.

Hope this helps!

2 Likes

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.