-
Notifications
You must be signed in to change notification settings - Fork 886
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
Uploading files when the app is teminated state #5481
Comments
Hi @ecr334, thanks for reaching out. When an application is terminated by the user (i.e. they remove it from the App Switcher by swiping up), iOS is expected to terminate any background transfer. Having said that, we have no control on whether it actually does, or when it does it. As a developer, there are some ways you can attempt to mitigate this, for example with a combination of Background Pushes, Background Sessions and/or Background Tasks. However, reliably achieving it using the TransferUtility might be tricky, as you'd probably need a tighter control of the involved instances. Having said that, consider that a user manually terminating the app by removing it from the App Switcher typically indicates that they do not wish the application to keep running, even in the background. |
@ruisebas Thanks for the quick response, I understand correctly that I don't need to manually initialize background sessions for TrasnferUtility instance ? everything is already working “under the hood” ? |
Yes, the Depending of your use case, you might need to take care of some things. Please check the Background Transfers section in our documentation. |
@ruisebas I am loading an array of photos, if data has been loaded in the background, how can I find out how many photos have been loaded before I refresh the progress bar? After a reboot, is there any method that checks the AWSS3TransferUtility for objects that have been previously loaded and skips them so that they are not loaded again? I have the work with the progress bar and start of loading is realized in an array loop, that is, it starts loading again every time and if the object has in the local base (already loaded) it skips, but if the loading was in the background, in the local base it will not update to the status of already loaded, how can I catch this moment ? |
Have you checked Managing Transfers When an App Restarts? |
@ruisebas , Yes, I have studied these methods, but I configure TransferUtility instance using configuration with accessKey, secretKey, sessionToken.
accordingly when initializing in AppDelegate.swift on application restart
I got an error, crashing
Since I have the accessToken/secretToken/secretKey data updated from our server every time, I can't assign it in the .json config file |
If you create and register your own Instead, you have to re-register the one you used before and call try await AWSS3TransferUtility.register(with:
configuration,
transferUtilityConfiguration: transferUtilityConfiguration,
forKey: uploadingUUID
)
guard let transferUtility = AWSS3TransferUtility.s3TransferUtility(forKey: transferUtilityKey) else {
print("Unable to retrieve Transfer Utility")
return
}
let blocks = AWSS3TransferUtilityBlocks(
// ...
)
transferUtility.enumerateToAssign(blocks: blocks) |
State your question
Hi, this question has been discussed many times before, but I faced a situation when dropbox mobile app performs file upload when the app is in terminated state (completely manually closed by the user from the application manager), maybe there is some solution that I did not notice in AWS S3, so that it is also possible to upload created tasks to upload when the app is closed manually ?
I tested dropbox application in such a case:
all this time after the 3rd point I didn't open dropbox ios app
I need to achieve the same result with AWS S3 TransferUtility uploading
Which AWS Services are you utilizing?
AWSS3 iOS
Provide code snippets (if applicable)
Environment(please complete the following information):
Device Information (please complete the following information):
If you need help with understanding how to implement something in particular then we suggest that you first look into our developer guide. You can also simplify your process of creating an application, as well as the associated backend setup by using the Amplify CLI.
The text was updated successfully, but these errors were encountered: