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
20190726 Background App Refresh Taskがやってきた
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Kei Ito
July 26, 2019
Programming
2.2k
0
Share
20190726 Background App Refresh Taskがやってきた
Kei Ito
July 26, 2019
More Decks by Kei Ito
See All by Kei Ito
20211015 Mac CatalystでmacOS用アプリを作る
itok
2
4.4k
20210219 Flutterに入門してみた
itok
1
4k
20201009 iOS 14 ウィジェットをつくってみた
itok
1
2.4k
20191206 Property Wrappers 入門
itok
0
1.7k
20190920 iOS 13 対応ではまった話
itok
1
2.4k
20190722 Firebase Remote Configでアドネットワークを管理する
itok
0
1.6k
20190419 iOSアプリで証明書の情報を参照する
itok
0
1.5k
20190412 Android TV向けアプリを作ってみる
itok
0
1.1k
20190215 iOS/Androidでドキュメントスキャナーを作ってみた
itok
0
1.8k
Other Decks in Programming
See All in Programming
テレメトリーシグナルが導くパフォーマンス最適化 / Performance Optimization Driven by Telemetry Signals
seike460
PRO
2
220
PHPのバージョンアップ時にも役立ったAST(2026年版)
matsuo_atsushi
0
290
夢の無限スパゲッティ製造機 -実装篇- #phpstudy
o0h
PRO
0
190
The Monolith Strikes Back: Why AI Agents ❤️ Rails Monoliths
serradura
0
240
[PHPerKaigi 2026]PHPerKaigi2025の企画CodeGolfが最高すぎて社内で内製して半年運営して得た内製と運営の知見
ikezoemakoto
0
340
存在論的プログラミング: 時間と存在を記述する
koriym
5
810
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
2
350
AI時代の脳疲弊と向き合う ~言語学としてのPHP~
sakuraikotone
1
1.8k
脱 雰囲気実装!AgentCoreを良い感じにWEBアプリケーションに組み込むために
takuyay0ne
3
440
ファインチューニングせずメインコンペを解く方法
pokutuna
0
270
アーキテクチャモダナイゼーションとは何か
nwiizo
17
4.4k
今からFlash開発できるわけないじゃん、ムリムリ! (※ムリじゃなかった!?)
arkw
0
190
Featured
See All Featured
The agentic SEO stack - context over prompts
schlessera
0
730
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
760
Game over? The fight for quality and originality in the time of robots
wayneb77
1
160
Typedesign – Prime Four
hannesfritz
42
3k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
250
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
370
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
Bash Introduction
62gerente
615
210k
Become a Pro
speakerdeck
PRO
31
5.9k
Mind Mapping
helmedeiros
PRO
1
140
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
Transcript
#BDLHSPVOE"QQ 3FGSFTI5BTL͕ ͖ͬͯͨ .PCJMF"DU04"," JUPL!ͦΒ͔ͥ
JUPL!ͦΒ͔ͥ w ͍ͱ͏͚͍ʢJUPLʣ w ɹɹɹɹɹɹͷதͷਓʢʴ෭ۀˏͯͳʣ w ϞόΠϧΞϓϦΤϯδχΞ݉$&0 w IUUQTJUPLKQ IUUQTTPSBLB[FDPKQ
!JUPLKQ
ॴࡏɿژࢢதژ۠ ࣾһਓࣗ
J04"OESPJENBD048JOEPXTαʔό ҰਓͰͬͯ·͢ʢσβΠϯҎ֎ʣ
#BDLHSPVOE"QQ 3FGSFTI5BTL͕ ͖ͬͯͨ
"EWBODFTJO"QQ #BDLHSPVOE&YFDVUJPO EFWFMPQFSBQQMFDPNWJEFPTQMBZXXED 88%$4FTTJPO
J04
#BDLHSPVOE5BTLT GSBNFXPSL
None
#BDLHSPVOE"QQ 3FGSFTI5BTL w ඵؒಈ͚Δ w ΞϓϦΛ࠷৽ͷঢ়ଶʹอͯΔ w CBDLHSPVOEGFUDIͷ"1*EFQSFDBUFE w NBD04چ"1*Ͱಈ͔ͳ͍͔ΒJ1BE04
$BUBMZTU͏ͳΒ͜ΕʹҠߦ͢͠
#BDLHSPVOE1SPDFTTJOH 5BTL w ಈ͚Δ w %#ͷϝϯςφϯεͱ͔ɺ.-ͷֶशͱ͔
४උ w DBQBCJMJUZˠCBDLHSPVOENPEFTˠ w CBDLHSPVOEGFUDI w CBDLHSPVOEQSPDFTTJOH w *OGPQMJTUˠ#(5BTL4DIFEVMFS1FSNJUUFE*EFOUJpFST w
λεΫͷࣝผࢠΛྻڍ
λεΫͷొ BGTaskScheduler.shared.register(forTaskWithIdentifier: "XXX", using: nil) { task in self.handleAppRefresh(task: task
as! BGAppRefreshTask) }
λεΫͷೖ func applicationDidEnterBackground(_ application: UIApplication) { scheduleAppRefresh() } func scheduleAppRefresh()
{ let request = BGAppRefreshTaskRequest(identifier: "XXX") request.earliestBeginDate = Date(timeIntervalSinceNow: 15 * 60) do { try BGTaskScheduler.shared.submit(request) } catch { print("Could not schedule app refresh: \(error)") } }
λεΫͷ࣮ߦ func handleAppRefresh(task: BGAppRefreshTask) { // ඞཁ͕͋Ε࠶ೖ scheduleAppRefresh() task.expirationHandler =
{ // ࣮ߦظݶ͕Εͨͱ͖ͷΩϟϯηϧॲཧ } // do something // λεΫྃ task.setTaskCompleted(success: true) }
ύϥϝʔλ w ڞ௨ w FBSMJFTU#FHJO%BUF w ԕ͗͢ΔະདྷͩΊ w िؒҎ͘Β͍͕·͍͠ w
ʮ࠷ʯͳͷͰ࣮ߦ͞ΕΔͱݶΒͳ͍
ύϥϝʔλ w QSPDFTTJOHUBTL w SFRVJSFT/FUXPSL$POOFDUJWJUZ w SFRVJSFT&YUFSOBM1PXFS w $16Λ͏ࣄΛ͢Δ߹USVFʹ͓ͯ͜͠͏
σόοά w σόοΨ͔ΒλεΫͷ࣮ߦظݶΕΛςετՄೳ IUUQTEFWFMPQFSBQQMFDPNEPDVNFOUBUJPOCBDLHSPVOEUBTLT TUBSUJOH@BOE@UFSNJOBUJOH@UBTLT@EVSJOH@EFWFMPQNFOU FMPCKD WPJE <<#(5BTL4DIFEVMFSTIBSFE4DIFEVMFS>a @TJNVMBUF-BVODI'PS5BTL8JUI*EFOUJpFS!999>
#BDLHSPVOEΛͯ͠ ΑΓΑ͍ϢʔβମݧΛʂ