Closed nick3389 closed 4 months ago
See Discussion :
Hi, @nick3389, the AWSS3StoragePlugin in Amplify version 2 uses a background URLSession so that downloads can continue even when the application is in the background:
Would you please let us know if this was what you were referring to?
Hi @jcjimenez,
Does this support uploads as well?
Hi, @nick3389,
Yes, this works for uploads also. However, there's one caveat: if the size of the file being uploading is larger than 5MB, then the upload will be split into separate [part] upload tasks. So, any tasks that are in progress when the app goes to the background will proceed, and if connectivity remains stable, will complete successfully. However, any subsequent [part] tasks will depend on the app coming back into the foreground so they can be started.
In other words, imagine the file being uploaded is divided into 10 parts and the first 3 start immediately after the call to Amplify.Storage.uploadFile
. These 3 tasks will continue even after your app goes into the background. However, the other remaining 7 tasks will be created by the app when one or more of the first 3 complete successfully.
Hi @jcjimenez
Thank you for the response. However, the 7 remaining tasks will be completed even if the app is in the background? Or does the app needs to be in the foreground again, complete the 3 tasks and then the rest 7 to start launching?
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Is your feature request related to a problem? Please describe.
The main scope is to support uploads mainly while the application is in the background. Currently this is not supported by Amplify SDK. You can read more about it in #638 .
Secondly, there is no support for setting up a
AWSServiceConfiguration
withAWSStaticCredentialsProvider
in Amplify.Describe the solution you'd like
A possible solution would be something like
AWSTransferUtility
that aws-ios-sdk has and supports background uploads. Also,AWSTransferUtility
can be setup with aAWSStaticCredentialsProvider
. However, the main issue here is the support of long running background uploads.Describe alternatives you've considered
No alternative with Amplify SDK. I still use the aws-ios-sdk.
Is the feature request related to any of the existing Amplify categories?
No response
Additional context
No response