Hook for receiving background URLSession events queued for app relaunch or by app extensions
@michalkcloudinay đang làm issue này rồi.
Từ ngày 22/2/2021.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Feature request for Cloudinary iOS SDK
Explain your use case
We have business logic to run in response to a upload task completion (success or failure), e.g., database write, backend API calls, file cleanup, etc. Most importantly, this has to be done for all uploads, regardless of whether it is started by the current application process or not.
This includes, e.g., an upload started by an earlier app invocation gracefully killed by the system, or an upload started by a Share Extension that dismisses the UI eagarly in anticipation of the app being woken up for the background transfer completion (e.g. this Apple Dev forum thread).
Describe the problem you’re trying to solve
The current Cloudinary SDK does not surface any hook for us to get notified about these events sent by sessionSendsLaunchEvents = true. This blocks us from implementing functional background uploads, especially for a Share Extension.
Having said that, it looks the SDK is already well-equipped to support processing and serving these events to the API. More specifically, it:
-
does not use the block/closure callback versions of the Upload/Download tasks; and
(so delegate callbacks won't get suppressed) -
already handles the completion handler for clients that have to handle URLSession events in their UIApplicationDelegate. (e.g., when the SDK user implemented it for other URLSessions)
Do you have a proposed solution?
In conjunction to setBackgroundCompletionHandler(_:), the Cloudinary SDK should provide an root-level API to register a callback for all task completions in the SDK instance. This will be backed by URLSession:task:didCompleteWithError: for certain.
The callback needs not provide a full CLDUploadRequest or CLDFetchImageRequest object* — the expectation is a minimal set of basic metadata, like unique file ID and resource type. These should sufficiently allow us to look up the associated operation log in our database, and resume the post-upload or post-download work as necessary.
[*] technically, this could be tough to implement anyway for little to no value. URLSession tasks received via the didCompleteWithError delegate message can be a task resurrected only for the message, and so have no associated CLD*Request in the current process.
- Ngôn ngữ chính
- Swift
- Star
- 169
- Fork
- 107
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của cloudinary/cloudinary_ios
-
Memory Leaks and Retain Cycles while using Upload with Cloudinary SDKCó thể làm lại được @adimiz1 đã nhận 713 ngày trước và không có pull request nào đang mở. Đang mở
cloudinary/cloudinary_ios#441 · 1 bình luận · 1 người được giao ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
cloudinary/cloudinary_ios#439 ·
-
Add MD5-Header option to CLDUploadRequestParamsCó thể làm lại được @adimiz1 đã nhận 1458 ngày trước và không có pull request nào đang mở. Đang mở
cloudinary/cloudinary_ios#390 · 1 bình luận · 1 người được giao ·
-
Unable to upload photo, uploadPrefix, unrecognized selectorCó thể làm lại được @adimiz1 đã nhận 1266 ngày trước và không có pull request nào đang mở. Đang mởbug
cloudinary/cloudinary_ios#369 · 2 bình luận · 1 người được giao ·
-
Does not compile for tvOSCó thể làm lại được @GiniAppsPartners đã nhận 2026 ngày trước và không có pull request nào đang mở. Đang mở
cloudinary/cloudinary_ios#337 · 1 bình luận · 2 người được giao ·
Tất cả issue của cloudinary/cloudinary_ios
Issue tương tự
-
cua-driver diagnose: one-line help says "install and permission report", which is macOS-specificĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
easy
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 5 ngày
-
15-minutes 5-minutes algorithm any-language beginner-friendly c cpp csharp easy go good first issue hacktoberfest help wanted java javascript kotlin python rust swift typescript
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
Huerte/algo-solutions-python#260 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100