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
iOS 7 - Background Fetching (CocoaHeads Lyon octobre 2013)
Search
Vincent Tourraine
October 11, 2013
Programming
0
190
iOS 7 - Background Fetching (CocoaHeads Lyon octobre 2013)
Billet de blog associé :
http://www.vtourraine.net/blog/ios-7-background-fetching
Vincent Tourraine
October 11, 2013
Tweet
Share
More Decks by Vincent Tourraine
See All by Vincent Tourraine
iOS 7 - View Controllers Custom Transitions (CocoaHeads Lyon avril 2014)
vtourraine
0
140
Activity View Controller (CocoaHeads Lyon octobre 2013)
vtourraine
0
100
Other Decks in Programming
See All in Programming
今の SmartHR にエンジニアで入社するとどうなるの?
daisukeshinoku
5
4.6k
Changed Rules: Architectures with Lightweight Stores
manfredsteyer
PRO
0
220
StreamlitとTerraformでデータカタログを作った話
gussan0223
0
290
ログラスを支える設計標準について / loglass-design-standards
urmot
10
2.1k
雑に思考を整理する技術と効能
konifar
55
24k
入門 AWS Amplify Gen2 / Introduction to AWS Amplify Gen2
genkiogasawara
1
310
甘い香りに誘われてVanilla Extractを1年間運用してみた
miyahkun
1
110
puregoの活用例
aethiopicuschan
0
220
スクラムガイドのスプリントレトロスペクティブを改めて読みかえしてみた / Re-reading the Sprint Retrospective Section in the Scrum Guide
mackey0225
3
320
CircleCIを活用して AWSへの継続的デリバリーを 実践する
coconala_engineer
1
230
TYPO3 v13 – The road to LTS: What's new and new APIs
luisasofie_xoxo
0
180
デザインシステムで Tailwind CSSとCSS in JSに分散投資をしたら良かった話
fsubal
18
4.8k
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
59
3.9k
Adopting Sorbet at Scale
ufuk
67
8.6k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
6
990
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
501
140k
How to train your dragon (web standard)
notwaldorf
71
5.1k
A designer walks into a library…
pauljervisheath
199
23k
Infographics Made Easy
chrislema
237
18k
Build The Right Thing And Hit Your Dates
maggiecrowley
23
2k
Typedesign – Prime Four
hannesfritz
36
2k
Music & Morning Musume
bryan
40
5.6k
Statistics for Hackers
jakevdp
789
220k
Build your cross-platform service in a week with App Engine
jlugia
224
17k
Transcript
Background Fetching CocoaHeads Lyon - octobre 2013 Vincent Tourraine -
shazino
Pour quoi faire ? ➡ Télécharger des nouvelles données sans
ouvrir l’application ➡ Exécution régulière en tâche de fond
Mise en place
Configuration du projet
Info.plist <key>UIBackgroundModes</key> <array> <string>fetch</string> </array>
Définir l’intervalle - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [application setMinimumBackgroundFetchInterval:
UIApplicationBackgroundFetchIntervalMinimum]; // ... }
Appel en tâche de fond - (void)application:(UIApplication *)application performFetchWithCompletionHandler: (void
(^)(UIBackgroundFetchResult))completionHandler { [self.manager GET:@"http://example.com/resources.json" parameters:nil success:^(id operation, id responseObject) { completionHandler(UIBackgroundFetchResultNewData); } failure:^(id operation, NSError *error) { completionHandler(UIBackgroundFetchResultFailed); }]; }
Debug
Configuration du scheme
Plus d’infos • UIApplication Class Reference https://developer.apple.com/library/ios/documentation/uikit/reference/ UIApplication_Class/Reference/Reference.html • UIApplicationDelegate
Protocol Reference https://developer.apple.com/library/ios/documentation/uikit/reference/ UIApplicationDelegate_Protocol/Reference/Reference.html