Device orientation controls - iOS - request permission or no?


The current versions of DeviceOrientationControls examples don’t work on my OP6T, OP6, IPhone X, IPhone 11.

I have the controls working on my project on my OnePlus devices. I’m still struggling getting any iOS devices to work. (strange bonus behaviour - OP6 required an https: connection, OP6T didn’t care and it worked on http: connection).

I read this issue about iOS13 on github - in which, this article about using ‘request.Permission()’ is referenced.

That issue was closed - and following @Mugen87 merges i ended up here. - I dont think the current example uses any form of permission request (but also isn’t working for me).

I’m now unclear whether the correct method for me to use is request.Permission() or not.

1 Like

It seems to me you have linked the wrong PR. The following one actually enhanced DeviceOrientationControls and introduced the usage of requestPermission().

A-ha! yes you’re right this is what I was looking for thank you.

Although I now realise that my project had the correct version of DeviceOrientationControls all along. Which puts me further away from understanding why it won’t work on iOS. :frowning:

This works on android:

dcontrols = new DeviceOrientationControls ( camera, renderer.domElement );

instructions.addEventListener( 'touchstart', function (evt) {
                dcontrols.enabled = true;
				console.log ('touch test');
                dcontrols.enabled = true;
       = 'none';
       = 'none';

			}, false );

SOLVED: added dcontrols.disconnect() straight after its created. Then dcontrols.connect() on touchstart and it not gives the proper permission prompt.