Javascript 无法检测WebVR模式-将手机插入纸板支架

Javascript 无法检测WebVR模式-将手机插入纸板支架,javascript,react-native,webview,expo,aframe,Javascript,React Native,Webview,Expo,Aframe,我正在尝试在上运行“hello world”示例。当我尝试进入虚拟现实模式(点击右下角的硬纸板图标)时,我收到一条信息“将手机插入硬纸板支架” 我找不到一个方法来传递这个信息。由于某种原因,它似乎无法检测到手机是否被放置在纸板支架内。我手机上的“自动旋转”功能已启用 当我按下“X”图标时,它会返回到标准3D模式(而不是分割屏幕) import React,{Component}来自'React'; 从“react native”导入{WebView}; 导出默认类MyWeb扩展组件{ rende

我正在尝试在上运行“hello world”示例。当我尝试进入虚拟现实模式(点击右下角的硬纸板图标)时,我收到一条信息“将手机插入硬纸板支架”

我找不到一个方法来传递这个信息。由于某种原因,它似乎无法检测到手机是否被放置在纸板支架内。我手机上的“自动旋转”功能已启用

当我按下“X”图标时,它会返回到标准3D模式(而不是分割屏幕)

import React,{Component}来自'React';
从“react native”导入{WebView};
导出默认类MyWeb扩展组件{
render(){
返回(
);
}
}
当前结果:

预期结果:


经过进一步调查,该应用程序被锁定在纵向模式,因此aframe无法检测横向方向

作为快速测试,我尝试了以下方法进行验证:

import React, { Component } from 'react';
import { WebView } from 'react-native';

export default class MyWeb extends Component {
  constructor(props) {
    super(props);
    Expo.ScreenOrientation.allow(Expo.ScreenOrientation.Orientation.LANDSCAPE)
  }
  render() {
    return (
      <WebView
        source={{uri: 'https://aframe.io/aframe/examples/boilerplate/hello-world'}}
        style={{marginTop: 20}}
      />
    );
  }
}
import React,{Component}来自'React';
从“react native”导入{WebView};
导出默认类MyWeb扩展组件{
建造师(道具){
超级(道具);
Expo.ScreenOrientation.allow(Expo.ScreenOrientation.Orientation.land)
}
render(){
返回(
);
}
}
import React, { Component } from 'react';
import { WebView } from 'react-native';

export default class MyWeb extends Component {
  constructor(props) {
    super(props);
    Expo.ScreenOrientation.allow(Expo.ScreenOrientation.Orientation.LANDSCAPE)
  }
  render() {
    return (
      <WebView
        source={{uri: 'https://aframe.io/aframe/examples/boilerplate/hello-world'}}
        style={{marginTop: 20}}
      />
    );
  }
}