Search Unity

IOS Post request with Raw data

Discussion in 'iOS and tvOS' started by tcvpromo, Jun 6, 2019.

  1. tcvpromo

    tcvpromo

    Joined:
    Jun 7, 2017
    Posts:
    25
    Hi,
    We are using unity 2019.1.4
    We have a problem with post "unitywebrequest" with image raw data.
    This problem only appears on IOS devices. The problem is not reproduced on android devices, webGL and from editor.
    In our game we dynamically make a texture, then we decode it into jpeg and send a request to the server via post request with raw data.


    In the center is the texture that we generate dynamically on the device. Then we decode this texture in jpeg and then send them via post request. (texture rendered with separate camera via rendertexture)

    But after converting to jpeg and sending it becomes like this.
    Sometimes the picture ends up normal. It seems that the picture does not have time to decode normally in jpeg.
    Has anyone encountered such a problem? Maybe problem with metal?
     

    Attached Files:

    • 6766.png
      6766.png
      File size:
      4 MB
      Views:
      1,635
    • 555.png
      555.png
      File size:
      204 KB
      Views:
      1,445
  2. tcvpromo

    tcvpromo

    Joined:
    Jun 7, 2017
    Posts:
    25
    Any help?
     
  3. winterhalder

    winterhalder

    Joined:
    Aug 24, 2015
    Posts:
    5
    We may be encountering the same problem.

    We are finding that when sending Posts of >5-6k there's a good chance the data send is garbled somewhat.

    We're currently preparing a defect to submit to Unity...
     
  4. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    There is a known issue with upload. The fix is in the works.
     
  5. sier_ua

    sier_ua

    Joined:
    Jan 19, 2017
    Posts:
    6
    I'm facing the same issue, has been driving me crazy over several days. Also, reproducible on iOS devices only. No matter how are you sending files - as multi-part form data files, or base64 encoded JSON values, PUT por POST requests - the result is always the same - some bytes are getting lost
     
  6. winterhalder

    winterhalder

    Joined:
    Aug 24, 2015
    Posts:
    5
    Hi Aurimas-Cernius,

    #1 - Great to hear!
    #2 - Is there a defect # of something that we can track?
    #3 - Do you know if they are targeting a fix for 2019.1.X, 2.X, etc?

    Thanks a bunch!

    Paul.
     
  7. winterhalder

    winterhalder

    Joined:
    Aug 24, 2015
    Posts:
    5
    Oh, and if folks are interested, we've documented the defect and created a small test app to reproduce (and detect the issue).

    It basically sends a large-ish request to a webhook that echos the data back. If the data doesn't match, the issue has occurred. Unity 2018.X works just fine, 2019.X intermittently fails (not 100% of the time, but way very regularly).

    https://forums.getbraincloud.com/topic/25/important-unity-2019-x-on-mobile-devices
     
  8. movingdimensions

    movingdimensions

    Joined:
    Jan 9, 2015
    Posts:
    18
    Just adding my voice to people who have encountered this issue. An update or a time-frame on one would be greatly appreciated.

    Thanks,
    Omar
     
  9. brownce

    brownce

    Joined:
    Sep 14, 2015
    Posts:
    18
    Would be nice to see this fixed. Seems pretty important if it's effecting data transfer between backends and the games.
     
  10. winterhalder

    winterhalder

    Joined:
    Aug 24, 2015
    Posts:
    5