You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to make this plugin work on iOS, you need to ask user permission for device orientation capture.
To do that, we need to insert the following code in the requestSession action.
Hello,
In order to make this plugin work on iOS, you need to ask user permission for device orientation capture.
To do that, we need to insert the following code in the requestSession action.
navigator.xr.requestSession('immersive-vr', {
requiredFeatures: thisXRMananger.gameModule.WebXR.Settings.VRRequiredReferenceSpace,
optionalFeatures: thisXRMananger.gameModule.WebXR.Settings.VROptionalFeatures
}).then(async (session) => {
if (typeof(DeviceOrientationEvent) !== "undefined" && typeof(DeviceOrientationEvent).requestPermission === 'function')
{
DeviceOrientationEvent.requestPermission()
.then(response => {
if (response === 'granted') {
session.isImmersive = true;
session.isInSession = true;
session.isAR = false;
thisXRMananger.xrSession = session;
thisXRMananger.onSessionStarted(session);
}
}).catch(function (error) {
thisXRMananger.BrowserObject.resumeAsyncCallbacks();
thisXRMananger.BrowserObject.mainLoop.resume();
});
} else {
session.isImmersive = true;
session.isInSession = true;
session.isAR = false;
thisXRMananger.xrSession = session;
thisXRMananger.onSessionStarted(session);
}
});
The text was updated successfully, but these errors were encountered: