-
Notifications
You must be signed in to change notification settings - Fork 155
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 stops when the device is locked. #220
Comments
After logs investigation I see: but there is no successful message: Looks strange like I see
but according to pattern of the message it is the following line which is ok: My thoughts about this problem: When I lock the device, the system calls the |
Intermediate results of my investigation: I noticed that I received the following logs: public func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) {
NSLog("URLSessionDidFinishEvents:")
session.getTasksWithCompletionHandler { (_, uploadTasks, _) in
NSLog("URLSessionDidFinishEvents:2")
self.semaphore.wait()
defer {
self.semaphore.signal()
}
if uploadTasks.isEmpty {
NSLog("all upload tasks have been completed")
self.backgroundTransferCompletionHander?()
self.backgroundTransferCompletionHander = nil
} else {
NSLog("tasks count: \(uploadTasks.count)")
for task in uploadTasks {
NSLog("tasks state: \(task.state.statusText())")
}
}
}
}
|
@w3ggy did you find any solution for this issue ? |
The case:
I want to make my app uploading 500-1000 images in the background even when the device is locked. Everything works fine when the app is in the foreground.
The issue:
When I lock the device, I don't receive any events neither in Flutter nor in native. Now it is impossible to debug the Flutter iOS app when the device is locked. Thus, I am trying to debug the native one.
The code for scheduling uploading on the Flutter side:
The background:
Data protection
for the app or set a specific level? I saw some problems with those settings on stackoverflow.com but not sure that it is a keyThe text was updated successfully, but these errors were encountered: