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
Apple Watch Cellular
Search
USAMI Kosuke
October 04, 2017
Programming
0
730
Apple Watch Cellular
Mobile Act OSAKA #1
https://mobileact.connpass.com/event/65935/
USAMI Kosuke
October 04, 2017
Tweet
Share
More Decks by USAMI Kosuke
See All by USAMI Kosuke
Onsager代数とその周辺 / Onsager algebra tsudoi
usamik26
0
530
Apple HIG 正式名称クイズ結果発表 / HIG Quiz Result
usamik26
0
110
ゆめみ大技林製作委員会の立ち上げの話 / daigirin project
usamik26
0
280
@ViewLoadingプロパティラッパの紹介と自前で実装する方法 / @ViewLoading property wrapper implementation
usamik26
0
430
これからUICollectionViewを実践活用する人のためのガイド / Guide to UICollectionView
usamik26
1
690
Xcodeとの最近の付き合い方のはなし / Approach To Xcode
usamik26
2
610
UICollectionView Compositional Layout
usamik26
0
680
Coding Swift with Visual Studio Code and Docker
usamik26
0
450
Swift Extension for Visual Studio Code
usamik26
2
910
Other Decks in Programming
See All in Programming
よくできたテンプレート言語として TypeScript + JSX を利用する試み / Using TypeScript + JSX outside of Web Frontend #TSKaigiKansai
izumin5210
6
1.7k
flutterkaigi_2024.pdf
kyoheig3
0
140
ヤプリ新卒SREの オンボーディング
masaki12
0
130
イベント駆動で成長して委員会
happymana
1
320
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.2k
Jakarta EE meets AI
ivargrimstad
0
200
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
230
色々なIaCツールを実際に触って比較してみる
iriikeita
0
330
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
330
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
230
OnlineTestConf: Test Automation Friend or Foe
maaretp
0
110
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
40
2.4k
Rails Girls Zürich Keynote
gr2m
94
13k
The Cult of Friendly URLs
andyhume
78
6k
The Pragmatic Product Professional
lauravandoore
31
6.3k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
130
Designing for humans not robots
tammielis
250
25k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
Thoughts on Productivity
jonyablonski
67
4.3k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Transcript
Apple Watch Cellular ͷ௨৴ʹ͍ͭͯ USAMI Kosuke Fenrir Inc.
ࣗݾհ » Ӊࠤݟެี (@usamik26) » ϑΣϯϦϧגࣜձࣾ » iOS ΞϓϦ։ൃ :
Swift / Xamarin (C#)
Cellular ௨৴͕͖ͬͯͨ » Apple Watch Series 3 Cellular Ϟσϧ »
ຊͷରԠΩϟϦΞ : Softbank / au / docomo » पଳผ : ϤʔϩούɾΞδΞϞσϧ / ถࠃϞσϧ / தࠃϞσϧ
Apple Watch ୯ಠͷ௨৴ » ୯ಠͷ Wi-Fi ௨৴ : watchOS 2
Ҏ߱ » ୯ಠͷ Cellular ௨৴ : watchOS 4 (New!)
ϞόΠϧ௨৴ͷΦϯΦϑ » Cellular ௨৴ͷΦϯΦϑɺίϯτϩʔϧηϯλʔͰઃఆՄೳ » Cellular ௨৴͕ΘΕ͍ͯΔͱ͖ɺΞΠίϯ͕ʹͳΔ
Apple Watch ௨৴ͷ༏ઌ » iPhone ܦ༝ ʼ Wi-Fi ʼ Cellular
௨৴
Γସ͑ͷλΠϜϥά » iPhone ͕ۙ͘ʹ͍ͳ͘ͳΔ » → ͍ͬͨΜɺଓͳ͠ঢ়ଶʹͳΔ » → ͠Β͔ͯ͘͠ΒɺCellular
௨৴Ͱଓঢ়ଶʹͳΔ » ͜ͷΑ͏ͳʮଓํࣜͷΓସ͑ͪʯ͕ൃੜ͢Δ
URLSession » watchOS ͷ௨৴ URLSession Λ͏͕ɾɾɾ » σϑΥϧτͷઃఆͰɺΓସ͑Λͨͣʹ͙͢Τϥʔऴྃ͢Δ » NSURLErrorNotConnectedToInternet
» ͔ͤͬ͘ Cellular ௨৴ʹΓସΘΔͷʹɺ͜ΕͰࠔΔ
waitsForConnectivity » ͙͢ʹΤϥʔऴྃ͠ͳ͍Α͏ʹ͢ΔϓϩύςΟ͕Ճ͞Εͨ let configuration = URLSessionConfiguration.ephemeral if #available(iOS 11.0,
watchOSApplicationExtension 4.0, *) { configuration.waitsForConnectivity = true } let session = URLSession(configuration: configuration)
Connectivity ͕ؔͳ͍ঢ়گͰ ͬͯΑ͍ » waitsForConnectivity σϑΥϧτͰ false ʹͳ͍ͬͯΔ » ͓ͦΒ͘ɺैདྷͷ
URLSession ͷڍಈʹ߹Θͤͯ͋Δ » ͚ͩͲɺৗʹ true ʹͯ͠͠·͍͍͑ » Reachability ͱ͔ؾʹ͠ͳͯ͘Α͘ͳΔ
Γସ͑ͪঢ়ଶʹͳͬͨ͜ͱΛΔ » URLSessionTaskDelegate ͷϝιου͕Ճ͞Εͨ func urlSession(_ session: URLSession, taskIsWaitingForConnectivity task:
URLSessionTask) { // ଓํࣜͷΓସ͑ͪঢ়ଶʹͳͬͨΒ͜͜དྷΔ // Ұ͚ͩݺΕΔ }
Watch ͷಠཱಈ࡞Λҙࣝ͢Δ » ࣮ watchOS 2 ͷࠒ͔Βಉ͡Ͱ͋Δ » watchOS 2
͔Β୯ಠ௨৴͕Ͱ͖ΔΑ͏ʹͳ͍ͬͯͨͨΊ » ୯ಠ௨৴ͷγʔϯ͕૿͑ͨͨΊɺࠓޙΑΓҙ͕ඞཁʹͳΔ
Watch Connectivity framework » ैདྷ͔Β͋Δ iPhone - Watch ؒͷσʔλΓऔΓ »
Watch ͕ಠཱͯ͑͠ΔΑ͏ʹͳͬͨͷͰɺಉظ͞Ε͍ͯͳ͍ঢ়ଶ ૿͑Δ » WCSession ͷ updateApplicationContext() Λͬͯ໌ࣔతʹಉظ ͢Δ
ࢀߟ » Updating for Apple Watch Series 3 - Videos
- Apple Developer » waitsForConnectivity | Apple Developer Documentation » App Programming Guide for watchOS » Apple Watch Series 3 (GPS + Cellular) ͰϞόΠϧσʔλ௨৴Λઃ ఆ͠༻͢Δ - Apple αϙʔτ