Slide 1

Slide 1 text

SIRIKIT AND ME 2017/9/15 IOSDC 2017

Slide 2

Slide 2 text

SIRIKIT AND ME ࣗݾ঺հ ▸ @TachibanaKaoru ▸ ϑϦʔϥϯε iOSΤϯδχΞ ▸ ϘϧμϦϯά͕޷͖Ͱɺ࠷ۙ͸ϦʔυΫϥΠϛϯά ΋νϟϨϯδதɻ ▸ Blog : http://www.toyship.org/

Slide 3

Slide 3 text

WHAT IS SIRIKIT?

Slide 4

Slide 4 text

SIRIKIT AND ME SIRIKIT ▸ iOS10͔Β ▸ Siri ΍ Map ΍ CarPlay ͳͲͷγεςϜΞϓϦ͔Βݺͼ ग़͞Εɺࣗ෼ͷΞϓϦΛ࿈ܞͰ͖Δػೳ ▸ ࣮૷Ͱ͖Δͷ͸ಛఆͷػೳʹݶΒΕ·͢

Slide 5

Slide 5 text

SIRIKIT AND ME SIRIKITͰ࣮૷Ͱ͖Δػೳ ▸ VoIP Calling ▸ Messaging ▸ Payments ▸ Lists and Notes ▸ Visual Codes ▸ Photos ‣ Workouts ‣ Ride Booking ‣ Car Commands ‣ CarPlay ‣ Restaurant Reservation

Slide 6

Slide 6 text

SIRIKIT AND ME RIDE BOOKING ▸ λΫγʔͷ഑ं ▸ Siri͔ΒͱMap͔ΒλΫγʔΛΑͿ͜ͱ͕Ͱ͖·͢ ▸ શࠃλΫγʔɺUber͕ରԠ͍ͯ͠·͢

Slide 7

Slide 7 text

TEXT ▸ (SiriΛ࢖ͬͯશࠃλΫγʔΞϓϦͰλΫγʔΛΑΜͩө૾)

Slide 8

Slide 8 text

SIRIKIT AND ME MESSAGING ▸ ϝοηʔδૹ৴ ▸ Siri͔ΒϝοηʔδΛૹΔ͜ͱ͕Ͱ͖Δɻ ▸ LINE͕ରԠ

Slide 9

Slide 9 text

TEXT ▸ ʢLINEΛ࢖ͬͯϝοηʔδΛૹͬͨө૾ʣ

Slide 10

Slide 10 text

SIRIKIT AND ME RESTAURANT RESERVATIONS ▸ Ϩετϥϯͷ༧໿ ▸ Map͔ΒϨετϥϯΛ༧໿͢Δ͜ͱ͕Ͱ͖·͢ɻ ▸ OpenTable͕ରԠ

Slide 11

Slide 11 text

WHY SIRIKIT?

Slide 12

Slide 12 text

SIRIKIT AND ME LINE TO THE APP ▸ ࢖༻ස౓ͷߴ͍γεςϜΞϓϦέʔγϣϯ͔Βࣗ ෼ͷΞϓϦ΁ͷಈઢΛ֬อ͢Δ͜ͱ͕Ͱ͖Δɻ

Slide 13

Slide 13 text

SIRIKIT AND ME ACCECIBILITY ▸ UIControl͸ɺ໨͕ݟ͑ͳ͍ਓ΁ͷ഑ྀΛߴΊͯ͸͍·͕͢ɺݸʑͷΞϓϦͷର Ԡ͸·ͩ·ͩे෼ͱ͸ݴ͑·ͤΜɻ ▸ SiriKitΛ࣮૷͢ΔͱɺΞϓϦͷUI͕ࢹ֮ো֐ऀʹ͸ෳࡶ͗͢Δ৔߹Ͱ΋ɺSiri͔Β ࢖͑ΔΑ͏ʹͳΓ·͢ɻ

Slide 14

Slide 14 text

SIRIKIT AND ME ACCECIBILITY ▸ ෗உࢠࣾ௕ɹୈे࿩ɿ໨͕ݟ͑ͳ͘ͳͬͨ࿩ʲલ ฤʳ ▸ ओਓެ͕ேى͖Δͱಥવ໨͕ݟ͑ͳ͘ͳΔγʔ ϯ͕͋Γɺ Siri ʹॿ͚ΛٻΊΔɻ ▸ Ҿ༻ݩ ▸ https://comic.pixiv.net/works/2930

Slide 15

Slide 15 text

SIRIKIT AND ME INTERNATIONALIZATION ▸ SiriKitʹରԠ͍ͯ͠Δͱɺ΋͠ຊମͷΞϓϦ͕೔ຊ ޠͷΈͷରԠͷ৔߹ʹ΋ɺSiriKitͰରԠ͍ͯ͠Δݴ ޠ͔ΒΑͿ͜ͱ͕Ͱ͖·͢ɻ ▸ ΞϥϏΞޠɺϔϒϥΠޠͳͲ͔Β΋࢖͑Δ……ͱࢥ ͍·͢ɻʢಈ࡞ະ֬ೝʣ

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

SIRIKIT AND ME HOMEPOD ▸ ݱঢ়Ͱ͸HomePodʹΞϓϦରԠ͸ൃද͞Ε͍ͯ ·ͤΜ͕ɺᗐ྽ͳઓ͍͕܁Γ޿͛ΒΕ͍ͯΔε ϚʔτεϐʔΧʔքͰɺαʔυύʔςΟʔ੡ͷ๛ ෋ͳΞϓϦʹରԠͰ͖Δར఺͸େ͖͍ɻ ▸ ͓ͦΒ࣍͘ͷWWDCͰ͸ɺHomePod΁ͷΞϓ ϦରԠ͕ൃද͞ΕΔ͸ͣɻ ▸ HomePodʹରԠͰ͖Δͷ͸ɺSiriKitʹରԠͯ͠ ͍ΔΞϓϦʹͳΔͰ͠ΐ͏ɻ

Slide 18

Slide 18 text

HOW TO SIRIKIT

Slide 19

Slide 19 text

SIRIKIT AND ME FRAMEWORK FOR SIRIKIT ▸ ࣮͸ SiriKit ͱ͍͏ϑϨʔϜϫʔΫ͸͋Γ·ͤΜɻ ▸ Intents SiriKitͷϩδοΫ෦෼Λ୲౰͢ΔϑϨʔϜϫʔΫ ▸ Intents UI SiriKitͷUI෦෼Λ୲౰͢ΔϑϨʔϜϫʔΫ

Slide 20

Slide 20 text

SIRIKIT AND ME ADD INTENTS TARGET ▸ Host AppΛ࡞ΓɺͦΕʹ Intents λʔήοτΛ௥Ճ͠·͢ɻ

Slide 21

Slide 21 text

SIRIKIT AND ME ADD CODES TO TARGET ▸ IntentsϑϨʔϜϫʔΫΛ௥Ճ͢Δͱɺ௥Ճ͞ΕͨϑΝΠϧͷதʹ Message IntentsʹରԠ͢ΔͨΊͷαϯϓϧίʔυ͕ॻ͍ͯ͋Γ·͢ɻMessage Intents ͩͬͨΒɺ͜Εʹ͕ͨͬͯ͠هड़͢Ε͹େৎ෉Ͱ͢ɻ ▸ ΄͔ͷIntentsͷ৔߹ʹ͸ɺରԠ͢ΔΫϥεΛ࣮૷͠·͢ɻ ▸ ͦͷIntents Target͕ͲͷIntentsʹରԠ͢Δͷ͔͸IntentsͷInfo.plistΛࢀরͯ͘͠ ͍ͩ͞ɻ

Slide 22

Slide 22 text

STRUGGLE WITH SIRIKIT

Slide 23

Slide 23 text

SIRIKIT AND ME ▸ SiriKitͰͷ։ൃʹ͸ɺ਺ଟ͘ͷࠔ೉ϙΠϯτ͕͋Γ·͕͢ɺ୅දతͳ΋ͷʹ͍ͭ ͯΈͯΈ·͠ΐ͏ɻ STRUGGLE WITH SIRIKIT

Slide 24

Slide 24 text

SIRIKIT AND ME EXTENSION ▸ SiriKit͸App ExtensionͷҰछͰ͢ɻ ▸ App Extension͸iOS8͔Β঺հ͞ΕͨɺγεςϜͷػೳΛݸผͷΞϓϦͰ֦ு͢ ΔͨΊͷ࢓૊ΈͰ͢ɻ ▸ Today ExtensionɺCusom KeyboardɺͳͲɺiOS11Ͱ͸23ݸ΋ͷApp Extension ͕͋Γ·͢ɻ

Slide 25

Slide 25 text

SIRIKIT AND ME EXTENSION ▸ App Extension͸ɺΞϓϦͷ഑෍࣌ʹ͸ Host App ͷBundleʹؚ·Ε·͢ɻ ▸ ͔͠͠ɺApp Extensionͷϓϩηε͸ɺHost Appͱ͸ผʹͳΓ·͢ɻ

Slide 26

Slide 26 text

SIRIKIT AND ME EXTENSION - MEMORY ▸ iOSͰ͸ϝϞϦʔۭؒͷΞΫηε͕ϓϩηε͝ͱʹ੍ݶ͞Ε͍ͯ·͢ɻ ▸ ͋ΔϓϩηεͰ֬อ͞Ε͍ͯΔϝϞϦʔ͸ɺଞͷϓϩηε͔ΒݟΔ͜ͱ͕Ͱ͖· ͤΜɻ

Slide 27

Slide 27 text

SIRIKIT AND ME EXTENSION - MEMORY ▸ ଞͷϓϩηεͰ֬อ͞Ε͍ͯΔϝϞϦʔΛࢀর͢ΔͱͲ͏ͳΔ͔Λ̎ͭͷΞϓϦ Λ࡞ͬͯͨΊͯ͠Έ·͠ΐ͏ɻ

Slide 28

Slide 28 text

SIRIKIT AND ME EXTENSION - MEMORY ▸ ·ͣɺAppleͱ Orangeͱ͍͏ೋͭͷΞϓϦΛ࡞Γ·͢ɻ ▸ AppleΞϓϦͰɺIntϙΠϯλΛ֬อ͠ɺͦ͜ʹʮ12345ʯΛ͍Ε·͢ɻ ▸ ͦͷIntϙΠϯλͷΞυϨε஋Λه࿥ɻ let ApplePtr = UnsafeMutablePointer.allocate(capacity:1) ApplePtr.pointee = 12345 let AppleValue = ApplePtr.pointee print(ApplePtr) // 0x00000001c0013570 print(AppleValue) // 12345

Slide 29

Slide 29 text

SIRIKIT AND ME EXTENSION - MEMORY ▸ OrangeΞϓϦΛىಈ͠·͢ɻʢApple ΞϓϦ͸όοΫάϥ΢ϯυঢ়ଶͱͳΓ· ͢ʣ ▸ ͦ͜Ͱɺ͖͞΄ͲAppleΞϓϦͰ֬อͨ͠IntϙΠϯλͷத਎Λ֬ೝɻ ▸ த਎͸ʮ0ʯͱͳΓ·͢ɻʢ͖͞΄ͲAppleΞϓϦ಺Ͱ֬ೝͨ͠஋͸ʮ12345ʯͰ ͨ͠ɻʣ var orangePtr = UnsafeMutablePointer.allocate(capacity:1) // + or - orangePtr and make it to 0x00000001c0013570 let orangeValue = orangePtr.pointee

Slide 30

Slide 30 text

SIRIKIT AND ME EXTENSION - MEMORY ▸ ଞͷϓϩηεͰ֬อͨ͠ϝϞϦʹ͍ͭͯ͸ɺͨͱ͑ͦͷΞυϨε͕Θ͔͍ͬͯͯ ΋஋Λࢀর͢Δ͜ͱ͸Ͱ͖·ͤΜɻ ▸ App Extention͸Host Appͱҧ͏ϓϩηεͷͨΊɺϝϞϦʔ্ͷ৘ใΛڞ༗Ͱ͖ ·ͤΜɻ ▸ ExtensionͷҰछͰ͋ΔIntents΋ɺಉ༷ʹ HostApp ͱϝϞϦʔঢ়ͷ৘ใΛڞ༗͢ Δ͜ͱ͸Ͱ͖·ͤΜɻ

Slide 31

Slide 31 text

SIRIKIT AND ME EXTENSION - MEMORY ▸ ϝϞϦʔ্ͷ৘ใڞ༗͕Ͱ͖ͳ͍৔߹ɺͲ͏΍ͬͯHost Appͱ৘ใΛڞ༗͢Δ ͔ɻ ▸ →ϑΝΠϧΩϟογϡΛ࢖͍·͢ɻ

Slide 32

Slide 32 text

SIRIKIT AND ME EXTENSION - FILE STORAGE ▸ iOSͰ͸ɺϑΝΠϧγεςϜ্ʹ Sandboxͱ͍͏࢓૊Έ͕͋ΓɺҰͭͷΞϓϦͷ File Storage͸ଞͷΞϓϦ͔ΒݟΔ͜ͱ͕Ͱ͖·ͤΜɻ ▸ ࣮͸ɺExtension΋ଞͷΞϓϦͱಉ͡ѻ͍ͱͳΓɺHost AppͷFile StorageͱApp ExtensionͷFile Storage͸ҧ͏৔ॴͱͳΓɺޓ͍ʹΞΫηε͢Δ͜ͱ͸Ͱ͖·ͤ Μɻ

Slide 33

Slide 33 text

SIRIKIT AND ME EXTENSION - FILE STORAGE ▸ ͦ͜Ͱɺڞ௨ʹ࢖͑ΔFile Storageͱͯ͠ɺApp GroupΛར༻͠·͢ɻ ▸ App Group͸ɺಉ͡DeveloperͷΞϓϦͲ͏͠Ͱಉ͡File StorageΛڞ༗͢Δ࢓ ૊ΈͰ͢ɻ ▸ App GroupͰΞϓϦؒσʔλڞ༗ ▸ http://www.toyship.org/archives/1845

Slide 34

Slide 34 text

SIRIKIT AND ME TIMEOUT ERROR ▸ Siri͸ϢʔβʔʹࣗવʹԠ౴͠ͳͯ͘͸͍͚ͳ͍ͨ ΊɺSiriKitͷॲཧʹ͸λΠϜΞ΢τ੍ݶ͕͋Γ· ͢ɻ ▸ ϩδοΫॲཧɺϏδωεॲཧʹ࣌ؒΛ͔͚Δ͜ͱ ͕Ͱ͖·ͤΜɻ ▸ ͕͔͔࣌ؒΔωοτϫʔΫॲཧͳͲ͸ɺϑΝΠϧ ΩϟογϡͳͲΛ࢖ͬͯϨεϙϯε࣌ؒΛ୹͘͢ Δ͜ͱ΋༗ޮɻ

Slide 35

Slide 35 text

SIRIKIT AND ME INTERNAL SERVER ERROR ▸ SiriKitͷIntentsϑϨʔϜϫʔΫͷΤϥʔ৘ใऔಘ͕ ೉͍͠ ▸ ໌֬ͳΤϥʔʢΤϥʔίʔυͳͲʣ͕ؼͬͯ͜ ͳ͍͜ͱ͕ଟ͍ɻʮ୯ʹࣦഊͨ͠ʯͱͳͬͯ͠ ·͏ͨΊɺσʔλͷϑΥʔϚοτΤϥʔͳͷ͔ɺ ϓϩύςΟʔͷΤϥʔͳͷ͔Θ͔Γ·ͤΜɻ ▸ SiriKitͷϑϨʔϜϫʔΫͷग़͢ϩάΛݟΕ͹൑໌ ͢ΔͷͰɺͦΕΛ֬ೝͨ͠΄͏͕͍͍Ͱ͠ΐ͏ɻ

Slide 36

Slide 36 text

SIRIKIT AND ME CHANGE ON VERSIONUP ▸ iOSͷόʔδϣϯΞοϓͰϨεϙϯε͕ҟͳΔ͜ͱ͕͋Γ· ͢ɻ ▸ iOSͷϚΠφʔόʔδϣϯΞοϓͰϓϩύςΟ͕͠Εͬͱ ૿ݮ͍ͯͨ͠ΓɺγεςϜ͕දࣔ͢ΔUI͕ҧͬͨΓ……ɻ ▸ ࣗ෼ͷίʔυ͸શ͘ม͑ͯͳ͍ͷʹಈ࡞͕มΘͬͯ͠·͏͜ ͱ΋͋Γɺ৺ͷ҆ఆΛอͯͳ͍͜ͱ΋͋Γ·͢ɻ ▸ ՄೳͰ͋Ε͹ɺγεςϜ͔ΒͷϨεϙϯεͷө૾΋ؚΊͨه ࿥Λ࢒͓ͯ͘͠ͱɺଟগ҆৺࣮ͯ͠૷͕͢͢ΊΒΕ·͢ɻ

Slide 37

Slide 37 text

SIRIKIT AND ME BUGS ON LANGUAGES ▸ AppleͰ͸SiriKitؔ࿈ͷػೳͷݕূ͸ӳޠΛத৺ʹߦΘΕ͍ͯ·͢ɻ ▸ ೔ຊޠͳͲɺӳޠҎ֎ͷݴޠͰಈ࡞ͤ͞Δͱɺҙਤͨ͠ಈ࡞ʹͳΒͳ͍͜ͱ΋͋ Γ·͢ɻ ▸ ྫ͑͹ɺࣸਅݕࡧͷIntentsͰ͸ɺ೔ຊޠͷ৔߹ʹจࣈྻ͕ద੾ʹ౉͞Εͳ͍ό άͳͲ͕͋Γ·͢ɻ ▸ SiriKit࣮૷࣌ʹ͸ӳޠ؀ڥͰ֬ೝ͢Δ͜ͱ΋ඞཁɻ

Slide 38

Slide 38 text

SIRIKIT AND ME HOW I STRUGGLE WITH SIRIKIT ▸ ࠓ೔ͷࢿྉͰޠΓ͖Εͳ͔ͬͨSiriKitͷ࣮૷ͷ TipsͳͲΛͪ͜ΒͰઆ໌͍ͯ͠·͢ɻ ▸ How I struggle with SiriKit. ▸ https://speakerdeck.com/toyship/how-i- struggle-with-sirikit

Slide 39

Slide 39 text

SIRIKIT AND ME ·ͱΊ ▸ SiriKit͸࣮૷ྔ͸গͳ͍Ͱ͕͢ɺσόοά࣌ʹ ৐Γӽ͑ͳͯ͘͸͍͚ͳ͍น͕ඇৗʹߴ͘ɺ 10೥ͷiOSܦݧͰҰ൪ͭΒ͍࣮૷Ͱͨ͠ɻ ▸ Ͱ΋HomePodରԠͳͲɺ৽͍͜͠Ε͔Βͷํ ޲ੑΛͻΒ͘΋ͷͳͷͰɺͥͻ࢖ͬͯΈͯͩ͘ ͍͞ɻ

Slide 40

Slide 40 text

TEXT ▸ ϥϯνͷ͓ళ༧໿ͯ͠ ▸ ΠλϦΞϯͰ ▸ ໌೔ͷ͔̍̎࣌̏̌Β ▸ ਓ਺͸ೋਓ ▸ ʮ͸͍ɻˎˎͰ12:30͔Β໊̎Ͱ༧໿Ͱ͖·ͨ͠ɻʯ

Slide 41

Slide 41 text

TEXT ▸ ϥϯνͷ༧໿ͯ͠ ▸ ໌೔ͷ͓னʹ༧ఆ͕ೖ͍ͬͯΔ͔Β͜Εͩͳ……ɻ ▸ ༧ఆ͸12:30͔Β͔ͩΒͦͷ࣌ؒʹ༧໿͠Α͏ ▸ ˎ͞Μͷ໊લ͕ೖͬͯΔ͔Β໊̎Ͱ͍͍ͳɻ ▸ ˎ͞Μͱͷϥϯν͸લճ΋͜ͷళ͔ͩͬͨΒ͜͜ʹ͠Α͏ ▸ ʮ͸͍ɻˎˎͰ12:30͔Β໊̎Ͱ༧໿Ͱ͖·ͨ͠ɻʯ

Slide 42

Slide 42 text

TEXT ▸ طଘͷϏδωεϩδοΫ͋Θ࣮ͤͯ૷Λ͢Δ ▸ ϏδωεϩδοΫʹ͋ΘͤͯϢʔβʔʹೖྗͤ͞Δ ▸ ͷͰ͸ͳ͘ɻ ▸ Ϣʔβʔͷཧ૝ͷUXʹϏδωεϩδοΫͱ࣮૷Λ͋Θ͍ͤͯ͘౒ྗΛ͢Δɻ