Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-24452

iOS: Handling responses from Ti.URLSession UploadTask API in the SDK

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 7.5.0
    • Component/s: None
    • Labels:
    • Environment:

      iOS sdk 6.x.x and below

      Description

      Version 2.1.0 of ti.urlsession has support for NSURLSessionUploadTask.
      Once the NSURLRequest is completed, the `sessioncompleted` event is fired with a success status, because the request received it's response.
      However, the response might have been a 401,still a success code would be set, because NSURLSessionUploadTask does not care for HTTP error statuses.
      We might also want to handle the response code after the upload task is completed.
      To do this we only need to add a delegate method from `NSURLSessionDataDelegate` and modify the sessioncompleted delegate.
      I will make a PR with the required changes, which are adding:

      -(void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveData:(NSData *)data
      

      and modify this other delegate method:

      -(void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error
      

        Attachments

          Activity

            People

            • Assignee:
              hknoechel Hans Knöchel
              Reporter:
              rlustemberg Richard Lustemberg
              Tester:
              Samir Mohammed
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-10524
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code