アプリのバックグラウンド処理 | iOS 7エンジニア勉強会

317 Views

October 09, 13

スライド概要

profile-image

2023年10月からSpeaker Deckに移行しました。最新情報はこちらをご覧ください。 https://speakerdeck.com/lycorptech_jp

シェア

またはPlayer版

埋め込む »CMSなどでJSが使えない場合

関連スライド

各ページのテキスト
1.

アプリのバックグラウンド処理 iOS 7 エンジニア勉強会@ヤフー 平松 亮介 @himara2 2013.10.07

2.

自己紹介 ・ヤフー株式会社CMOアプリ開発室 フォトコミュニケーション部Kawaiiフォト加工チーム ・女子向けアプリ Petapic のiOS開発担当 ・アプリのバックグランド処理 について話します

3.

バックグラウンド処理 ・ex) 音楽を聞きながらFacebookアプリを使う ・バックグラウンド状態でもアプリが活躍できる 僕の来た道はバックグラウンドで 位置を記録し続ける

4.

マルチタスク関連のAPI ^{ Background Task Completion NE W !! Background Audio Background Fetch Location Services Silent Push Notification VoIP Background Transfer Time Newsstand

5.

便利な3つの新機能 Background Fetch Silent Push Notification Background Transfer

6.

Background Fetch 概要 ・アプリ使用の流れ(従来)

7.

Background Fetch 概要 ・アプリ使用の流れ(従来) ・この遅延がユーザ体験を妨げている ・起動したら即コンテンツ表示したい

8.

Background Fetch 概要 ・アプリ使用の流れ(with Background Fetch) OSが適切なタイミングで コンテンツ更新を呼ぶ

9.

Background Fetch OSの学習 Day 1 Day 2 Day n Prediction 9:00 OSがユーザの 行動パターンを解析 12:00 16:00 22:00 適切なタイミング

10.

Background Fetch 実装ポイント ・Background Modes で “Background fetch” にチェック ・呼び出しの最短間隔を設定 ・[[UIApplication sharedApplication] setMinimumBackgroundFetchInterval: UIApplicationBackgroundFetchIntervalMinimum]; ・OSが適当なタイミングでアプリを起こし、処理を実行 AppDelegate application:performFetchWithCompletionHandler:

11.

Background Fetch Demo

12.

Background Fetch こんなアプリで使える ・日常的に, 頻繁に使われるアプリ - アプリを起動したら最新情報が表示される!

13.

便利な3つの新機能 Background Fetch Silent Push Notification Background Transfer

14.

Silent Push Notification 概要 ・Remote Push Notification の拡張版

15.

Push通知(iOS 6) apns { alert : { ... } } Silent Push Notification サーバー ④コンテンツ更新 APNs ①push ⑤表示 ③起動 ②通知表示

16.

Silent Push Notification Push通知(iOS 7) apns { content-available:1, alert : { ... } } サーバー ③バックグラウンド でコンテンツ更新 APNs ①push ⑤アプリ表示 ②バックグラウンド で起動 ④通知表示

17.

Silent Push Notification 実装ポイント ・Background Modes で “Remote notifications” にチェック ・silent pushを受け取ったタイミングで処理を実行 AppDelegate application:didReceiveRemoteNotification:fetchCompletionHandler

18.

Silent Push Notification Demo

19.

Silent Push Notification こんなアプリで使える ・不定期にコンテンツを受け取るサービス - メッセージングサービスやメールなど - Pushが届いて開くと最新のメッセージが表示されている!

20.

便利な3つの新機能 Background Fetch Silent Push Notification Background Transfer

21.

Background Transfer 概要 ・バックグラウンドで大容量ファイルのDL/ULが可能に - Task Completionのような時間制限はない ・プロセスはOSが管理してくれる

22.

Background Transfer Demo

23.

Background Transfer こんなアプリで使える ・容量の大きなファイルを扱うアプリ

24.

Background Transfer 注意 ・バックグラウンドでのDL/ULはWi-Fi下でのみ発動 ・Background Fetch, Silent Pushと組み合わせると強力 コンテンツに変更があった → Silent Pushで端末を起こす →大容量のファイルをBackground Transferで同期 →完了したらLocal Notificationで通知

25.

その他

26.

ユーザ設定 ・設定からBackground実行を制限できる - Location Services - Background Fetch - Silent Push Notification - Background Transfer ・設定状態を取得するAPIが Coming soon. 設定 > 一般 > Appのバックグラウンド更新

27.

App Switcher ・「UIが良いとユーザは復帰する」 ・App Switcherで消すと, アプリはバックグラウンド動作☓ ホームボタンを2回クリック

28.

End iOS 7 study What’s New With Multitasking Ryosuke Hiramatsu