You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The current Box SDK library does not support background sessions. An error is thrown at NetworkClient.swift#L86 with the message: Completion handler blocks are not supported in background sessions. Use a delegate instead.
Additionally, the library does not differentiate between request types for creating background-compatible upload tasks, which are necessary for handling uploads in the background. This lack of support limits the SDK's utility for apps that need to perform background uploads (and downloads).
Describe the solution you'd like
I would like the SDK to support background sessions by transitioning from a callback-based API to a delegate-based API. Specifically, there should be differentiation in request creation to use URLSessionUploadTask, as this type of task allows for uploads in the background, unlike data tasks.
This change would require modifying the API to accept file URLs instead of InputStreams to comply with the requirements of URLSessionUploadTask and enable background operation.
Describe alternatives you've considered
I have already forked the repository and made the necessary changes to support background sessions by:
Refactoring the API to use delegates instead of callbacks.
Differentiating request creation to use networkSession.session.uploadTask() as well.
Switching from InputStream to file URLs for upload tasks.
However, since this project appears to be generated, integrating these changes directly through a PR may not be practical due to the extent of the modifications, resulting in hundreds of lines of code changes.
The text was updated successfully, but these errors were encountered:
Thank you for your support in the development of our SDK ❤️
Your change looks fine, however, as you mentioned, our SDK is generated, so implementing this requires significant additional effort from us. Additionally, by adding a URL here instead of an InputStream, we are changing the contract we have in our codegen compared to other languages, which further complicates the matter.
At the moment, we cannot implement this, but we will definitely do it before the official release. We are leaving the ticket open, as soon as we add it, we will inform you.
Thank you once again for your support in our new box-swift-sdk-gen.
Is your feature request related to a problem? Please describe.
The current Box SDK library does not support background sessions. An error is thrown at NetworkClient.swift#L86 with the message:
Completion handler blocks are not supported in background sessions. Use a delegate instead.
Additionally, the library does not differentiate between request types for creating background-compatible upload tasks, which are necessary for handling uploads in the background. This lack of support limits the SDK's utility for apps that need to perform background uploads (and downloads).
Describe the solution you'd like
I would like the SDK to support background sessions by transitioning from a callback-based API to a delegate-based API. Specifically, there should be differentiation in request creation to use
URLSessionUploadTask
, as this type of task allows for uploads in the background, unlike data tasks.This change would require modifying the API to accept file
URL
s instead ofInputStream
s to comply with the requirements ofURLSessionUploadTask
and enable background operation.Describe alternatives you've considered
I have already forked the repository and made the necessary changes to support background sessions by:
networkSession.session.uploadTask()
as well.InputStream
to fileURL
s for upload tasks.My changes can be viewed here: tobihagemann/box-swift-sdk-gen@a6b5793...b2bb9db
However, since this project appears to be generated, integrating these changes directly through a PR may not be practical due to the extent of the modifications, resulting in hundreds of lines of code changes.
The text was updated successfully, but these errors were encountered: