Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

272
Views
Background image (Background Mode) uploading in Amazon S3 bucket without using AWS SDK in iOS Swift

I have an application that capture image/images, the request is fired for getting the document upload policies, and uploading the image/images starts. When user is in the foreground the image/images uploads but when user is in the background the image/images do not gets uploaded or failed to upload. So I want to upload the image/images when the application is in the background (Background Mode).

What is the right path to follow for the Background (Background Mode) Uploading of the image/images?

The application is written in Swift 2.3

Any Help would be Appriciated

Thanks

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Use AWSS3TransferUtility which handles background uploads

    import AWSS3

    let transferUtility = AWSS3TransferUtility.default()
    //In order to customize the header information, we use the AWSS3TransferUtilityUploadExpression class
    let expression = AWSS3TransferUtilityUploadExpression()

    //We want our file to be publicly available by default
    expression.setValue("public-read", forRequestParameter: "x-amz-acl")

    //Copy the custom Meta information into the expression
    transferUtility.uploadFile(uploadRequest.body, bucket: uploadRequest.bucket ?? "", key: uploadRequest.key ?? "", contentType: uploadRequest.contentType ?? "", expression: expression) { (task, error) in }

Dont forget to add below code in your app delegate

func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String, completionHandler: @escaping () -> Void) {
    /*
     Store the completion handler.
     */
    AWSS3TransferUtility.interceptApplication(application, handleEventsForBackgroundURLSession: identifier, completionHandler: completionHandler)
}
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!