Close Menu
  • Home
  • AI
  • Big Data
  • Cloud Computing
  • iOS Development
  • IoT
  • IT/ Cybersecurity
  • Tech
    • Nanotechnology
    • Green Technology
    • Apple
    • Software Development
    • Software Engineering

Subscribe to Updates

Get the latest technology news from Bigteetechhub about IT, Cybersecurity and Big Data.

    What's Hot

    Building the Digital Foundation for a Smarter West Lincoln Memorial Hospital

    April 21, 2026

    Hackers exploit Vercel’s trust in AI integration

    April 21, 2026

    iPhone 16 models still come with a SIM card tray everywhere outside the US

    April 21, 2026
    Facebook X (Twitter) Instagram
    Facebook X (Twitter) Instagram
    Big Tee Tech Hub
    • Home
    • AI
    • Big Data
    • Cloud Computing
    • iOS Development
    • IoT
    • IT/ Cybersecurity
    • Tech
      • Nanotechnology
      • Green Technology
      • Apple
      • Software Development
      • Software Engineering
    Big Tee Tech Hub
    Home»iOS Development»ios – Why does cancelByProducingResumeData() return nil for upload tasks?
    iOS Development

    ios – Why does cancelByProducingResumeData() return nil for upload tasks?

    big tee tech hubBy big tee tech hubDecember 12, 20250161 Min Read
    Share Facebook Twitter Pinterest Copy Link LinkedIn Tumblr Email Telegram WhatsApp
    Follow Us
    Google News Flipboard
    ios – Why does cancelByProducingResumeData() return nil for upload tasks?
    Share
    Facebook Twitter LinkedIn Pinterest Email Copy Link


    I’m implementing resumable uploads on iOS based on this documentation and wwdc video

    The server correctly sends a 104 Upload Resumption Supported informational response, which I receive in my delegate. However, when I cancel the upload task using cancelByProducingResumeData(), it always returns nil.

    Setup

    • iOS 18/26
    • HTTP/2 server with TLS (using SwiftNIO + Network.framework)
    • Server implements the resumable upload draft protocol

    Client Code

    class VideoUploader: NSObject, URLSessionTaskDelegate, URLSessionDataDelegate {
        private var urlSession: URLSession!
        private var uploadTask: URLSessionUploadTask?
    
        func uploadVideo(fileURL: URL) {
            var request = URLRequest(url: URL(string: "
            request.httpMethod = "POST"
            request.setValue("?0", forHTTPHeaderField: "Upload-Incomplete")
            request.setValue("3", forHTTPHeaderField: "Upload-Draft-Interop-Version")
    
            uploadTask = urlSession.uploadTask(with: request, fromFile: fileURL)
            uploadTask?.resume()
    
            // Cancel after 3 seconds to test resume data
            Task {
                try? await Task.sleep(for: .seconds(3))
                guard let uploadTask else { return }
                let resumeData = await uploadTask.cancelByProducingResumeData()
                print("Resume data: \(resumeData)") // Always prints nil
            }
        }
    
        // This IS called - server sends 104 correctly
        func urlSession(_ session: URLSession, task: URLSessionTask, didReceiveInformationalResponse response: HTTPURLResponse) {
            print("Received 104: \(response.statusCode)")
            print("Location: \(response.allHeaderFields["Location"] ?? "none")")
        }
    }
    

    Here’s a repo with server side code and app that reproduces the issue.

    Any idea what I could be missing, or even how I could debug this?



    Source link

    cancelByProducingResumeData iOS nil Return tasks upload
    Follow on Google News Follow on Flipboard
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Copy Link
    tonirufai
    big tee tech hub
    • Website

    Related Posts

    swiftui – How I make quiz in interactive widget for iOS 17 +?

    April 21, 2026

    DTCoreText 2.0 | Cocoanetics

    April 20, 2026

    ios – Xcode can’t find headers file from added frameworks

    April 19, 2026
    Add A Comment
    Leave A Reply Cancel Reply

    Editors Picks

    Building the Digital Foundation for a Smarter West Lincoln Memorial Hospital

    April 21, 2026

    Hackers exploit Vercel’s trust in AI integration

    April 21, 2026

    iPhone 16 models still come with a SIM card tray everywhere outside the US

    April 21, 2026

    Testlio Takes On AI Chatbot Risk Before It Reaches Customers

    April 21, 2026
    Timer Code
    15 Second Timer for Articles
    20
    About Us
    About Us

    Welcome To big tee tech hub. Big tee tech hub is a Professional seo tools Platform. Here we will provide you only interesting content, which you will like very much. We’re dedicated to providing you the best of seo tools, with a focus on dependability and tools. We’re working to turn our passion for seo tools into a booming online website. We hope you enjoy our seo tools as much as we enjoy offering them to you.

    Don't Miss!

    Building the Digital Foundation for a Smarter West Lincoln Memorial Hospital

    April 21, 2026

    Hackers exploit Vercel’s trust in AI integration

    April 21, 2026

    Subscribe to Updates

    Get the latest technology news from Bigteetechhub about IT, Cybersecurity and Big Data.

      • About Us
      • Contact Us
      • Disclaimer
      • Privacy Policy
      • Terms and Conditions
      © 2026 bigteetechhub.All Right Reserved

      Type above and press Enter to search. Press Esc to cancel.