Search Unity

Does UnityWebRequest works in windows 10/UWP?

Discussion in 'Scripting' started by cdytoby, Aug 11, 2016.

  1. cdytoby

    cdytoby

    Joined:
    Nov 19, 2014
    Posts:
    181
    The new UnityWebRequest seems great but I don't know if it supports windows 10/UWP store app.
     
  2. SynchroAR

    SynchroAR

    Joined:
    Dec 7, 2016
    Posts:
    6
    Do we have an answer for this...?
     
  3. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,187
  4. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,732
    Yes, it does work on almost all platforms. From memory it does not work in Nintendo 3DS and Switch platforms.
     
  5. SynchroAR

    SynchroAR

    Joined:
    Dec 7, 2016
    Posts:
    6
    It does work on Editor under UWP platform, but when I export the app into HoloLens, it does not seem to work.
    Is there something I am missing, or HoloLens does not support it..?

    I am using Unity 5.6.3f Pro with VS2015 10.0.14393.
     
  6. SynchroAR

    SynchroAR

    Joined:
    Dec 7, 2016
    Posts:
    6
    I have changed the code to WWW from UnityWebRequest, and now it works...
    Any idea on why this is...?
     
  7. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,187
    Without knowing how you were using it, there isn't much we can tell you. (as in without seeing code and knowing what you were trying to do).
     
  8. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,692
    We've switched to UnityWebRequest for a lot of stuff and we're finding it's not really feature-complete yet as of Unity 5.6.2.

    For instance, it is not possible to open and read stuff from /StreamingAssets using UnityWebRequest. Why on earth Unity hasn't fixed this glaring deficiency yet is a mystery, but it is documented here:

    https://unity3d.com/learn/tutorials/temas/best-practices/assetbundle-usage-patterns

    and search for Android to see the specific issue I ran into.

    Wouldn't surprise me if UWR doesn't work with other platforms if it doesn't work with Android Streaming Assets!

    Seems safest to stick with a tried-and-true WWW class at this stage, which actually CAN do all the above.
     
  9. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,732
    UnityWebRequest can read from StreamingAssets since 2017.1 on Android.
     
  10. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,692
    Will that be ported back to 5.6.x or are we perpetual pro license holders just out of luck? :)
     
  11. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,732
    In 5.6 you should use AssetBundle.LoadFromFileAsync, that is much more efficient than UnityWebRequest. This is one of the main reasons why it's disabled in 5.6.