Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question iOS WebRequest Does not work - cloud build

Discussion in 'Editor & General Support' started by daveMennenoh, Apr 6, 2023.

  1. daveMennenoh

    daveMennenoh

    Joined:
    May 14, 2020
    Posts:
    100
    Can anyone please give this a test? Unity engineer would be really nice... all I get is the can being kicked down the road. I need to figure this out.

    I am using Cloud Build to build to iOS. This super simple connection check is returning 'unknown error' and I cannot figure out why. I am on 2021.3.22f1

    Super simple code that fails on ios. Works in Editor and on a MS Surface fine.

    Code (CSharp):
    1. IEnumerator checkConnection(Action<bool> action)
    2.     {
    3.         UnityWebRequest request = UnityWebRequest.Head("https://www.readysetvr.com/");
    4.         request.timeout = 5;
    5.         yield return request.SendWebRequest();
    6.  
    7.         if (request.error != null)
    8.         {
    9.             action(false);
    10.         }
    11.         else
    12.         {
    13.             action(true);
    14.         }
    15.     }
     
  2. daveMennenoh

    daveMennenoh

    Joined:
    May 14, 2020
    Posts:
    100
    Anyone? I feel I'm missing something but not sure what. Do I need to enable internet somehow if I build to iOS?
     
  3. daveMennenoh

    daveMennenoh

    Joined:
    May 14, 2020
    Posts:
    100
    So, I installed iOS build platform so I can affect the settings. I enabled persistent WiFi connection and have the 'allow unsafe downloads over http' checked.
    But I am using Cloud Build and am unsure if those settings are actually used. I just save my project, upload to Git, and then build...
    I wonder if those settings are used because I still cannot connect to the internet from Unity.
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,711
    Can you get the plist file out of the cloud-built .ipa and compare it with the one you build locally that works?

    If you don't have a Mac at least see if you can suss anything out of that plist.

    ALSO: can you try a super-stripped-down project built on cloud? I forget from your other thread if you did this already... and by stripped down I mean with no funky build scripts that might be fiddling with your plist.
     
  5. daveMennenoh

    daveMennenoh

    Joined:
    May 14, 2020
    Posts:
    100
    Thanks, but I'm not using any build scripts. And no, I don't have a mac - what's working locally is if I build to Windows and test on desktop or on my MS Surface. I'll see if I can get the .plist though.
     
  6. daveMennenoh

    daveMennenoh

    Joined:
    May 14, 2020
    Posts:
    100
    Well. F*** all that. Doesn't matter anymore. Thanks for the help but I got laid off today. Good luck to the next person that works for this company.