Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
While Your App is Sleeping
Search
Gwendolyn Weston
September 08, 2015
Technology
660
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
While Your App is Sleeping
Gwendolyn Weston
September 08, 2015
More Decks by Gwendolyn Weston
See All by Gwendolyn Weston
Keep Calm and Type Erase On
gwengrid
3
25k
Other Decks in Technology
See All in Technology
【AG-UI × A2UI × MCP Apps】Generative UIをやさしく解説する
nrinetcom
PRO
1
140
Eight Engineering Unit 紹介資料
sansan33
PRO
3
8.2k
도구에서 동료까지: 10년차 AI 스타트업의 AI 적응기
inureyes
PRO
0
230
ラジオの科学
frievea
0
350
【CEDEC2026】Creative Approaches to Localizing the Dialects and Unique Speech of Umamusume: Pretty Derby Characters in English
cygames
PRO
3
25k
Digitization部 紹介資料
sansan33
PRO
2
7.7k
Software Supply Chain Attackからクラウド環境を守るためにできること
lhazy
2
280
【GCC2026】大規模言語モデルを活用した内製検索サービスの社内展開や業務活用
bandainamcostudios
PRO
0
280
20260807_第6回_関東kaggler会LT_claw系bot xangiと始める、"寂しくない" kaggle
sugupoko
0
360
LLM・AIエージェントシステムベストプラクティス
shibuiwilliam
6
1.5k
Model Studio CLI × Token Plan
maigo999
0
190
老害フォレンジッカーはAI羊の夢を見るか?
tadmaddad
0
350
Featured
See All Featured
Embracing the Ebb and Flow
colly
88
5.1k
エンジニアに許された特別な時間の終わり
watany
108
250k
Docker and Python
trallard
47
4.1k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.1k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
670
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.4k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
470
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
440
Testing 201, or: Great Expectations
jmmastey
46
8.2k
A Soul's Torment
seathinner
6
3.5k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
250
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
940
Transcript
While Your App Was Sleeping Gwendolyn Weston @purpleyay
Background Transfer Services allows uploading or downloading requests to continue
on after app is terminated
Motivation
A Teakettle • That requires you to stand near it
• As well as continue to watch in order for it to boil water
Where can this happen in our apps?
PlanGrid
To guarantee download completion • Users would have to change
their settings so that the device never locks • Stay on the app
Downloading without Background Transfer Services is like watching water boil.
Overview • How to download in the foreground • How
to make that request background compatible • How to navigate common pitfalls
Downloading in the foreground
Downloading in Foreground
Downloading in Foreground NSURLSession: vends and manages requests
Downloading in Foreground sharedSession: singleton session with default settings
Downloading in Foreground NSURLSessionDownloadTask: the request
NSURLSessionTask • NSURLSessionDownloadTask • NSURLSessionUploadTask • NSURLSessionDataTask - short-lived requests
(not background compatible!)
We get tasks by feeding our session URLs
Cookie Monster as NSURLSession
None
Downloading in Foreground
Downloading in Foreground
Downloading in Foreground
Downloading in Foreground
Downloading in the background
Downloading in Foreground
None
NSURLSessionConfiguration: defines request behaviour and policies
None
Identifiers must be unique!
“I’m done downloading!!! Wake up!” application: handleEventsForBackgroundURLSession: completionHandler “It’s me,
the session called waterBoiling Session!”
None
!!Must!! re-instantiate session with identifier or delegate methods for request
will not get called.
“The behavior of multiple sessions sharing the same identifier is
undefined.”
Downloading in Background
None
Downloading in Background
“Completion handler blocks are not supported in background sessions”
Pitfall no completion handlers
Downloading in Background
“I’m done downloading!!! Wake up!” URLSession:downloadTask:didFinishDownloadingTo URL: “It’s me, the
request for task 42 in the session called boilingWaterSession!”
The delegate!
Downloading in Background
None
Downloading in Background
Pitfall No auxiliary request info
Promising… ?
Nope.
Subclasses?
None
Downloading in Background
“Can I have—“ “No.” “Just one subclass—“ “No.” NSURLSession
Persistence!
Downloading in Background
YUSS.
Questions? @purpleyay