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

    Databricks Spatial Joins Now 17x Faster Out-of-the-Box

    December 27, 2025

    Strain-Tuned 2D Materials with Sharper Detection of Toxic Gases

    December 27, 2025

    Cisco Meraki + PagerDuty Integration for Faster Incident Response

    December 27, 2025
    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, 20250151 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

    ios – SwiftUI-Button: Complete VStack clickable

    December 26, 2025

    ios – ld: framework ‘Pods_MyProjectName’ not found

    December 25, 2025

    Hundreds of Big Post-Election Donors Have Benefited From Trump’s Return to Office

    December 25, 2025
    Add A Comment
    Leave A Reply Cancel Reply

    Editors Picks

    Databricks Spatial Joins Now 17x Faster Out-of-the-Box

    December 27, 2025

    Strain-Tuned 2D Materials with Sharper Detection of Toxic Gases

    December 27, 2025

    Cisco Meraki + PagerDuty Integration for Faster Incident Response

    December 27, 2025

    This tiny chip could change the future of quantum computing

    December 27, 2025
    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!

    Databricks Spatial Joins Now 17x Faster Out-of-the-Box

    December 27, 2025

    Strain-Tuned 2D Materials with Sharper Detection of Toxic Gases

    December 27, 2025

    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
      © 2025 bigteetechhub.All Right Reserved

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