Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support long running background uploads/downloads #1559

Closed
nick3389 opened this issue Dec 7, 2021 · 6 comments
Closed

Support long running background uploads/downloads #1559

nick3389 opened this issue Dec 7, 2021 · 6 comments
Labels
connectivity Problems related to network connectivity feature-request Request a new feature storage Issues related to the Storage category

Comments

@nick3389
Copy link

nick3389 commented Dec 7, 2021

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 with AWSStaticCredentialsProvider 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 a AWSStaticCredentialsProvider. 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

@atierian atierian added feature-request Request a new feature pending-triage Issue is pending triage labels Dec 7, 2021
@brennanMKE brennanMKE added storage Issues related to the Storage category and removed pending-triage Issue is pending triage labels Dec 8, 2021
@brennanMKE brennanMKE added the connectivity Problems related to network connectivity label Feb 7, 2022
@brennanMKE
Copy link
Contributor

See Discussion :

@jcjimenez
Copy link
Contributor

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:

https://github.com/aws-amplify/amplify-swift/blob/main/AmplifyPlugins/Storage/Sources/AWSS3StoragePlugin/Service/Storage/AWSS3StorageService.swift#L73

Would you please let us know if this was what you were referring to?

@jcjimenez jcjimenez added the closing soon This issue will be closed in 7 days unless further comments are made. label Apr 18, 2023
@nick3389
Copy link
Author

Hi @jcjimenez,

Does this support uploads as well?

@jcjimenez
Copy link
Contributor

jcjimenez commented Apr 25, 2023

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.

@jcjimenez jcjimenez added closing soon This issue will be closed in 7 days unless further comments are made. and removed closing soon This issue will be closed in 7 days unless further comments are made. labels Apr 25, 2023
@nick3389
Copy link
Author

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?

@royjit royjit removed the closing soon This issue will be closed in 7 days unless further comments are made. label May 2, 2023
@harsh62 harsh62 closed this as completed Jul 11, 2024
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
connectivity Problems related to network connectivity feature-request Request a new feature storage Issues related to the Storage category
Projects
None yet
Development

No branches or pull requests

6 participants