Search Unity

UnityWebRequest is ignoring timeout on iOS

Discussion in 'iOS and tvOS' started by srdr, Jul 18, 2019.

  1. srdr

    srdr

    Joined:
    Jan 11, 2019
    Posts:
    1
    Hi,
    Setting the timeout property of UnityWebRequest does not work on iOS. Looking deeper into the problem, I've found out that there is a problem in the Classes/Unity/UnityWebRequest.mm file. The method called UnitySendWebRequest gets a parameter called timeoutSec, but does not pass it to the NSMutableURLRequest instance and just ignores it. So timeout does not work on iOS. Manually editing this method and adding the line below solves the issue but I think it's something Unity should solve, not me.

    [request setTimeoutInterval:timeoutSec];
     
    savam and fakegood like this.
  2. savam

    savam

    Joined:
    Jan 12, 2015
    Posts:
    1
    Thanks, srdr, your solution works.
    Problem is still happening in Unity 2019.1.8f1 :(
     
  3. kaarloew

    kaarloew

    Joined:
    Nov 1, 2018
    Posts:
    360
    Have you opened a bug ticket for this?
     
  4. sguyge

    sguyge

    Joined:
    Nov 15, 2016
    Posts:
    5
  5. AurimasA

    AurimasA

    Unity Technologies

    Joined:
    Apr 24, 2017
    Posts:
    24
    sguyge likes this.
  6. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,731
    The fix is the pipeline for release. It will take some time until it's released though.
     
    sguyge likes this.
  7. sguyge

    sguyge

    Joined:
    Nov 15, 2016
    Posts:
    5
  8. charmcrescini

    charmcrescini

    Joined:
    Sep 9, 2019
    Posts:
    18
    It also did not work for me. How did you do it?