Hook for receiving background URLSession events queued for app relaunch or by app extensions
@michalkcloudinay ya está trabajando en esto.
Desde el 22/2/2021.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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.
- Lenguaje dominante
- Swift
- Estrellas
- 169
- Forks
- 107
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de cloudinary/cloudinary_ios
-
Memory Leaks and Retain Cycles while using Upload with Cloudinary SDKQuizá libre de nuevo @adimiz1 la tomó hace 713 días y no hay ningún pull request abierto. Abierto
cloudinary/cloudinary_ios#441 · 1 comentario · 1 asignado ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
cloudinary/cloudinary_ios#439 ·
-
Add MD5-Header option to CLDUploadRequestParamsQuizá libre de nuevo @adimiz1 la tomó hace 1458 días y no hay ningún pull request abierto. Abierto
cloudinary/cloudinary_ios#390 · 1 comentario · 1 asignado ·
-
Unable to upload photo, uploadPrefix, unrecognized selectorQuizá libre de nuevo @adimiz1 la tomó hace 1266 días y no hay ningún pull request abierto. Abiertobug
cloudinary/cloudinary_ios#369 · 2 comentarios · 1 asignado ·
-
Does not compile for tvOSQuizá libre de nuevo @GiniAppsPartners la tomó hace 2026 días y no hay ningún pull request abierto. Abierto
cloudinary/cloudinary_ios#337 · 1 comentario · 2 asignados ·
Todos los issues de cloudinary/cloudinary_ios
Issues similares
-
cua-driver diagnose: one-line help says "install and permission report", which is macOS-specificAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
easy
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 5 días
-
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
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
Huerte/algo-solutions-python#260 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100