UnityWebRequest的Oculus Quest问题

时间:2019-07-11 14:33:47

标签: unity3d oculus

我正在尝试对API进行unityWebRequest,并且一切都可以在正常的unity应用程序上顺利运行,但是当我将方法“ checkCode()”调用触发GetAuthRequest()时,立即将应用程序转移到oculus quest oculus应用程序执行unityWebRequest的方法崩溃。

我尝试用几种不同的方式重写代码,似乎没有什么可以解决此问题。我的任务可以访问互联网,我相信我已经安装了Android SDK。

public void CheckCode()
{
    StartCoroutine(GetAuthRequest("http://myURL/", attemptedCode));
}

IEnumerator GetAuthRequest(string uri, string attemptedCode)
{
    setValue("IN_REQ");
    using (UnityWebRequest webRequest = UnityWebRequest.Get(uri + attemptedCode))
    {
        //// Request and wait for the desired page.
        yield return webRequest.SendWebRequest();
        if (webRequest.isNetworkError)
        {
           setValue("NET_ERROR");
        }
        else
        {
           if (webRequest.downloadHandler.text.Equals("true"))
           {
               ClearCode();
               setValue("Authenticated!");
           }
           else
           {
                ClearCode();
                setValue("Error...");
           }
       }
   }
}

1 个答案:

答案 0 :(得分:-1)

尝试使用“ https://myURL/”代替“ http://myURL/

相关问题