Hook for receiving background URLSession events queued for app relaunch or by app extensions
@michalkcloudinay já está trabalhando nisso.
Desde 22/2/2021.
Avaliação
Esta issue ainda não foi avaliada.
Descrição
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.
- Linguagem predominante
- Swift
- Estrelas
- 169
- Forks
- 107
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Sem guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de cloudinary/cloudinary_ios
-
Memory Leaks and Retain Cycles while using Upload with Cloudinary SDKTalvez livre de novo @adimiz1 assumiu há 713 dias e não há nenhum pull request aberto. Aberta
cloudinary/cloudinary_ios#441 · 1 comentário · 1 responsável ·
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 20/100
cloudinary/cloudinary_ios#439 ·
-
Add MD5-Header option to CLDUploadRequestParamsTalvez livre de novo @adimiz1 assumiu há 1458 dias e não há nenhum pull request aberto. Aberta
cloudinary/cloudinary_ios#390 · 1 comentário · 1 responsável ·
-
Unable to upload photo, uploadPrefix, unrecognized selectorTalvez livre de novo @adimiz1 assumiu há 1266 dias e não há nenhum pull request aberto. Abertabug
cloudinary/cloudinary_ios#369 · 2 comentários · 1 responsável ·
-
Does not compile for tvOSTalvez livre de novo @GiniAppsPartners assumiu há 2026 dias e não há nenhum pull request aberto. Aberta
cloudinary/cloudinary_ios#337 · 1 comentário · 2 responsáveis ·
Todas as issues de cloudinary/cloudinary_ios
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
vorssaint/vorssaint-utils#4162 ·
Mantenedores costumam responder em até 2 dias
-
cua-driver diagnose: one-line help says "install and permission report", which is macOS-specificAberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Opening PortKiller force-kills every cloudflared quick tunnel on the machine, not just its ownTalvez já em andamento @widechaos assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
productdevbook/port-killer#131 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia
-
easy
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
Mantenedores costumam responder em até 5 dias