Skip to content

Does Amplify.Storage support background upload? #1096

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

Closed
yusuftor opened this issue Mar 11, 2021 · 4 comments
Closed

Does Amplify.Storage support background upload? #1096

yusuftor opened this issue Mar 11, 2021 · 4 comments
Labels
closing soon This issue will be closed in 7 days unless further comments are made. duplicate This issue or pull request already exists question General question storage Issues related to the Storage category

Comments

@yusuftor
Copy link

yusuftor commented Mar 11, 2021

I know that TransferUtility supports background upload. However, it doesn't mention this functionality anywhere in the Amplify docs for Storage upload. Can someone confirm whether this is or isn't possible, and if so how?

@lawmicha
Copy link
Contributor

Hi @yusuftor, thanks for the link. It is possible because the storage plugin is implemented using TransferUtility, so if you perform an Amplify.Storage.upload/download, and background the app, the operation will continue to operate since it is using TransferUtility internally. This implementation detail is subject to change, which is why it is not documented as we have not explicited designed the storage plugin to do so.

There aren't any supporting APIs for background transfers on the storage plugin such as to store the application's handleEventsForBackgroundURLSession completion handler and wake the app when the transfer is completed, or allowing the developer to manage a transfer when a suspended app returns to the foreground. The capability to fully manage transfers is limited. With the exception of the functionality mentioned, does this support your use case? if not, could you expand on what you are trying to do?

@lawmicha lawmicha added question General question pending-community-response Issue is pending response from the issue requestor storage Issues related to the Storage category labels Mar 11, 2021
@yusuftor
Copy link
Author

Thanks for the quick reply @lawmicha. Is it possible to get hold of the underlying TransferUtility singleton from the Amplify instance? Actually I was wanting to use the handleEventsForBackgroundURLSession, and I thought maybe I could pass it to Amplify's singleton of TransferUtility.

@lawmicha lawmicha added follow up Requires follow up from maintainers and removed pending-community-response Issue is pending response from the issue requestor labels Mar 11, 2021
@lawmicha
Copy link
Contributor

Hi @yusuftor, technically it is possible by using the same key to reference the TransferUtility singleton that Amplify.Storage internally uses, but I don't think that is a robust way, another option would be to directly use TransferUtility if that functionality is a strong requirment for you. we have a feature request over here #1102 that is related this

@palpatim palpatim added duplicate This issue or pull request already exists closing soon This issue will be closed in 7 days unless further comments are made. and removed follow up Requires follow up from maintainers labels Apr 9, 2021
@github-actions
Copy link
Contributor

This issue is being automatically closed due to inactivity. If you believe it was closed by mistake, provide an update and re-open it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closing soon This issue will be closed in 7 days unless further comments are made. duplicate This issue or pull request already exists question General question storage Issues related to the Storage category
Projects
None yet
Development

No branches or pull requests

3 participants