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
Webの技術とガジェットで子どもも大人も楽しめるワクワク体験を提供する / Qiita Tech Festa Day 2026
you
PRO
1
310
最高のシステムプロンプトを作るためにフィードバック機能を導入した話
alchemy1115
0
220
最新IoT事例11選に学ぶ!現場の成功パターンと実践のコツ【SORACOM Discovery 2026】
soracom
PRO
0
120
PLaMo 3.0 Primeの事後学習
pfn
PRO
0
100
検索技術知識0のエンジニアが広告検索システムを内製化して運用するまで
lycorptech_jp
PRO
0
150
QA・ソフトウェアテスト研修【MIXI 26新卒技術研修】
mixi_engineers
PRO
3
1.7k
2026年のソフトウェア開発を考える(2026/07版) / Agentic Software Engineering 2026-07 Findy Edition
twada
PRO
31
21k
事業成長とAI活用を止めないデータ基盤アーキテクチャの設計思想
hiracky16
0
770
現場との対話から始める “作る前に問い直す”業務改善
mochico50
2
340
NYC Summit 2026 におけるAmazon Bedrock AgentCore のアップデート
ren8k
2
270
脱Jenkins、インターン生が挑んだCIツールGitHubActions移行
mixi_engineers
PRO
1
260
害獣害虫を自動判別! ペストコントロール支援ビジネス成功のヒント【SORACOM Discovery 2026】
soracom
PRO
0
120
Featured
See All Featured
Claude Code のすすめ
schroneko
67
230k
Paper Plane (Part 1)
katiecoart
PRO
1
9.9k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
400
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
980
Speed Design
sergeychernyshev
33
2k
Building an army of robots
kneath
306
46k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.5k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
670
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
230
Are puppies a ranking factor?
jonoalderson
1
3.7k
Designing Experiences People Love
moore
143
24k
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