Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

273
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda