what's new in core location - wwdc 2015
TRANSCRIPT
![Page 1: What's New in Core Location - WWDC 2015](https://reader033.vdocuments.net/reader033/viewer/2022042608/55c11717bb61eb3f6b8b477a/html5/thumbnails/1.jpg)
What's New in Core Location
Kosuke Ogawa (@koogawa) 2015.7.7 WWDC 2015 情報共有会 #WWDC21cafe
![Page 2: What's New in Core Location - WWDC 2015](https://reader033.vdocuments.net/reader033/viewer/2022042608/55c11717bb61eb3f6b8b477a/html5/thumbnails/2.jpg)
• 小川航佑 Kosuke Ogawa • @koogawa • フリーランス • iOSアプリを仕事・趣味でいろいろ開発
60万DL突破! 20万DL突破!
![Page 3: What's New in Core Location - WWDC 2015](https://reader033.vdocuments.net/reader033/viewer/2022042608/55c11717bb61eb3f6b8b477a/html5/thumbnails/3.jpg)
Background location
![Page 4: What's New in Core Location - WWDC 2015](https://reader033.vdocuments.net/reader033/viewer/2022042608/55c11717bb61eb3f6b8b477a/html5/thumbnails/4.jpg)
Capabilities > Background Modes > Location updates
![Page 5: What's New in Core Location - WWDC 2015](https://reader033.vdocuments.net/reader033/viewer/2022042608/55c11717bb61eb3f6b8b477a/html5/thumbnails/5.jpg)
• バックグラウンドで位置情報を更新するにはYES
• デフォルトではNO
![Page 6: What's New in Core Location - WWDC 2015](https://reader033.vdocuments.net/reader033/viewer/2022042608/55c11717bb61eb3f6b8b477a/html5/thumbnails/6.jpg)
Single location
![Page 7: What's New in Core Location - WWDC 2015](https://reader033.vdocuments.net/reader033/viewer/2022042608/55c11717bb61eb3f6b8b477a/html5/thumbnails/7.jpg)
• 一度だけの位置情報取得が可能に
• iOSとwatchOS 2で利用可能
• 成功時:locationManager:didUpdateLocations:
• 失敗時:locationManager:didFailWithError:
![Page 8: What's New in Core Location - WWDC 2015](https://reader033.vdocuments.net/reader033/viewer/2022042608/55c11717bb61eb3f6b8b477a/html5/thumbnails/8.jpg)
Authorization
![Page 9: What's New in Core Location - WWDC 2015](https://reader033.vdocuments.net/reader033/viewer/2022042608/55c11717bb61eb3f6b8b477a/html5/thumbnails/9.jpg)
Request Authorization
• requestWhenInUseAuthorization
• requestAlwaysAuthorization
![Page 10: What's New in Core Location - WWDC 2015](https://reader033.vdocuments.net/reader033/viewer/2022042608/55c11717bb61eb3f6b8b477a/html5/thumbnails/10.jpg)
Apple Watch
• watchOS 2からWatch単体で位置情報が取得できるように
• 許可を求める際のフローが変わっている
![Page 11: What's New in Core Location - WWDC 2015](https://reader033.vdocuments.net/reader033/viewer/2022042608/55c11717bb61eb3f6b8b477a/html5/thumbnails/11.jpg)
iPhoneで許可する場合
![Page 12: What's New in Core Location - WWDC 2015](https://reader033.vdocuments.net/reader033/viewer/2022042608/55c11717bb61eb3f6b8b477a/html5/thumbnails/12.jpg)
Apple Watchで許可する場合
![Page 13: What's New in Core Location - WWDC 2015](https://reader033.vdocuments.net/reader033/viewer/2022042608/55c11717bb61eb3f6b8b477a/html5/thumbnails/13.jpg)
Apple Watch: Best practice
![Page 14: What's New in Core Location - WWDC 2015](https://reader033.vdocuments.net/reader033/viewer/2022042608/55c11717bb61eb3f6b8b477a/html5/thumbnails/14.jpg)
![Page 15: What's New in Core Location - WWDC 2015](https://reader033.vdocuments.net/reader033/viewer/2022042608/55c11717bb61eb3f6b8b477a/html5/thumbnails/15.jpg)
![Page 16: What's New in Core Location - WWDC 2015](https://reader033.vdocuments.net/reader033/viewer/2022042608/55c11717bb61eb3f6b8b477a/html5/thumbnails/16.jpg)
![Page 17: What's New in Core Location - WWDC 2015](https://reader033.vdocuments.net/reader033/viewer/2022042608/55c11717bb61eb3f6b8b477a/html5/thumbnails/17.jpg)
watchOS 2~• startUpdatingLocation などの継続的に位置情報を取得するメソッドが使えない(deprecatedではなく使用不可)
• requestLocation を使う必要がある
• 継続的に取得したい場合は Watch Connectivity を使う
![Page 18: What's New in Core Location - WWDC 2015](https://reader033.vdocuments.net/reader033/viewer/2022042608/55c11717bb61eb3f6b8b477a/html5/thumbnails/18.jpg)
参考資料• What's New in Core Locationhttps://developer.apple.com/videos/wwdc/2015/?id=714
• PotLoc: CoreLocation with iPhone and Apple Watchhttps://developer.apple.com/library/prerelease/watchos/samplecode/PotLoc/Introduction/Intro.html
![Page 19: What's New in Core Location - WWDC 2015](https://reader033.vdocuments.net/reader033/viewer/2022042608/55c11717bb61eb3f6b8b477a/html5/thumbnails/19.jpg)
ありがとう ございました