Closed phil1995 closed 2 years ago
Hey, there are currently no plans to add official support for background sessions. At least for the next quarter.
That being said, it is currently possible to create a PCloudClient
with a background URLSession
, although not in a very obvious way. You can take a look at the implementation of
func createClient(withAccessToken accessToken: String, apiHostName: String) -> PCloudClient
method in PCloud.swift
. All of the building blocks of a PCloudClient
are public. You just need to use a different URLSession
.
However, the SDK does not currently make it easy to use a background session. For example, you might want to persist URLSessionTask
identifiers so on the next process instance you know which files are still uploading/downloading or finished. That will not be possible unless you intercept URLSessionTask
creation. Which can be done but it requires non-superficial knowledge into the inner workings of the SDK and not something clients of the SDK should have to do.
Can you tell me what you need the SDK to offer other than just injecting a URLSession
? It will be helpful once we get around to making enhancements to the SDK.
Closing due to inactivity.
Are there any plans to support background
URLSession
? We would like to use a backgroundURLSession
for larger uploads/downloads in our project.