Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
iOS 7 - Background Fetching (CocoaHeads Lyon octobre 2013)
Vincent Tourraine
October 11, 2013
Programming
0
150
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
120
Activity View Controller (CocoaHeads Lyon octobre 2013)
vtourraine
0
89
Other Decks in Programming
See All in Programming
AmebaのDesign SystemとCompose
messi_0601
0
200
パラメタライズドテスト
ledsun
0
220
タップルでComposeの段階的な導入を進めている話
ymshun
1
170
YATA: collaborative documents and how to make them fast
horusiath
1
170
SwiftUI+TCAに挑戦!NewsPicks iOSアプリのリアーキテクチャ/re-architecture-newspicks-ios-app-with-swiftui-and-tca
takehilo
0
420
Computer Vision Seminar 1/コンピュータビジョンセミナーvol.1 OpenCV活用
fixstars
0
180
kintoneでランダム取得を作ってみた(imoniCamp 2022-07-27)
shokun1108
0
150
それ全部エラーメッセージに書いてあるよ!〜独学でPHPプログラミングが上達するたった一つの方法〜
77web
1
160
Untangling Coroutine Testing (Droidcon Berlin 2022)
zsmb
2
500
アジャイルで始める データ分析基盤構築
nagano
1
930
Web Componentsを作れる デザインツールの開発
seanchas116
0
250
There's an API for that!
mariatta
PRO
0
110
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
19
3.1k
What's new in Ruby 2.0
geeforr
335
30k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
119
28k
How New CSS Is Changing Everything About Graphic Design on the Web
jensimmons
213
11k
Bootstrapping a Software Product
garrettdimon
296
110k
What’s in a name? Adding method to the madness
productmarketing
11
1.6k
Stop Working from a Prison Cell
hatefulcrawdad
262
17k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
351
21k
The Invisible Customer
myddelton
110
11k
A Philosophy of Restraint
colly
192
15k
VelocityConf: Rendering Performance Case Studies
addyosmani
316
22k
Producing Creativity
orderedlist
PRO
334
37k
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