Oculusquest 内部的HTTP请求将开始不调用
我重写Oculusquest 内部的HTTP请求将开始不调用,oculusquest,Oculusquest,我重写grabbeing函数,并尝试在用户抓取对象时发出Post请求。但看起来请求从未被调用过。吊牌上没有错误或警告问题。我还尝试使用Debug.Log(“抓取开始”)打印到控制台,但从未打印到控制台。我不确定我错过了什么。我仍然能够通过虚拟现实抓取一个物体 public class AromaShooterGrabbable : OVRGrabbable { override public void GrabBegin(OVRGrabber hand, Collider grabPoi
grabbeing
函数,并尝试在用户抓取对象时发出Post请求。但看起来请求从未被调用过。吊牌上没有错误或警告问题。我还尝试使用Debug.Log(“抓取开始”)
打印到控制台,但从未打印到控制台。我不确定我错过了什么。我仍然能够通过虚拟现实抓取一个物体
public class AromaShooterGrabbable : OVRGrabbable
{
override public void GrabBegin(OVRGrabber hand, Collider grabPoint) {
base.GrabBegin(hand, grabPoint);
RestClient.Post<AromaShooterResponse>(url, new Post {
duration = 3000,
channel = 1,
intensity = 100
}).Then(response => {
Debug.Log(response.status);
}).Catch(error => {
Debug.Log(error.Message);
});
}
}
公共类AromaShooterGrabbable:OVRGrabbable
{
覆盖公共无效抓取开始(OVRGrabber手,碰撞器抓取点){
抓取开始(手,抓取点);
RestClient.Post(url,新帖子{
持续时间=3000,
通道=1,
强度=100
})。然后(响应=>{
Debug.Log(response.status);
}).Catch(错误=>{
Debug.Log(错误消息);
});
}
}
回答我自己的问题
在AndroidManifest.OVRSubmission.xml中添加:
<manifest>
<uses-permission android:name="android.permission.INTERNET" />
<application
android:networkSecurityConfig="@network_sec_config"
>
</manifest>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">*</domain>
</domain-config>
<base-config cleartextTrafficPermitted="true"></base-config>