SiriKit and Me

61a68b2172503ecdf7a7f7757df56071?s=47 Tachibana Kaoru
September 15, 2017

SiriKit and Me

iOSDC2017

61a68b2172503ecdf7a7f7757df56071?s=128

Tachibana Kaoru

September 15, 2017
Tweet

Transcript

  1. SIRIKIT AND ME 2017/9/15 IOSDC 2017

  2. SIRIKIT AND ME ࣗݾ঺հ ▸ @TachibanaKaoru ▸ ϑϦʔϥϯε iOSΤϯδχΞ ▸

    ϘϧμϦϯά͕޷͖Ͱɺ࠷ۙ͸ϦʔυΫϥΠϛϯά ΋νϟϨϯδதɻ ▸ Blog : http://www.toyship.org/
  3. WHAT IS SIRIKIT?

  4. SIRIKIT AND ME SIRIKIT ▸ iOS10͔Β ▸ Siri ΍ Map

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

    Payments ▸ Lists and Notes ▸ Visual Codes ▸ Photos ‣ Workouts ‣ Ride Booking ‣ Car Commands ‣ CarPlay ‣ Restaurant Reservation
  6. SIRIKIT AND ME RIDE BOOKING ▸ λΫγʔͷ഑ं ▸ Siri͔ΒͱMap͔ΒλΫγʔΛΑͿ͜ͱ͕Ͱ͖·͢ ▸

    શࠃλΫγʔɺUber͕ରԠ͍ͯ͠·͢
  7. TEXT ▸ (SiriΛ࢖ͬͯશࠃλΫγʔΞϓϦͰλΫγʔΛΑΜͩө૾)

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

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

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

    OpenTable͕ରԠ
  11. WHY SIRIKIT?

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

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

  14. SIRIKIT AND ME ACCECIBILITY ▸ ෗உࢠࣾ௕ɹୈे࿩ɿ໨͕ݟ͑ͳ͘ͳͬͨ࿩ʲલ ฤʳ ▸ ओਓެ͕ேى͖Δͱಥવ໨͕ݟ͑ͳ͘ͳΔγʔ ϯ͕͋Γɺ

    Siri ʹॿ͚ΛٻΊΔɻ ▸ Ҿ༻ݩ ▸ https://comic.pixiv.net/works/2930
  15. SIRIKIT AND ME INTERNATIONALIZATION ▸ SiriKitʹରԠ͍ͯ͠Δͱɺ΋͠ຊମͷΞϓϦ͕೔ຊ ޠͷΈͷରԠͷ৔߹ʹ΋ɺSiriKitͰରԠ͍ͯ͠Δݴ ޠ͔ΒΑͿ͜ͱ͕Ͱ͖·͢ɻ ▸ ΞϥϏΞޠɺϔϒϥΠޠͳͲ͔Β΋࢖͑Δ……ͱࢥ

    ͍·͢ɻʢಈ࡞ະ֬ೝʣ
  16. None
  17. SIRIKIT AND ME HOMEPOD ▸ ݱঢ়Ͱ͸HomePodʹΞϓϦରԠ͸ൃද͞Ε͍ͯ ·ͤΜ͕ɺᗐ྽ͳઓ͍͕܁Γ޿͛ΒΕ͍ͯΔε ϚʔτεϐʔΧʔքͰɺαʔυύʔςΟʔ੡ͷ๛ ෋ͳΞϓϦʹରԠͰ͖Δར఺͸େ͖͍ɻ ▸

    ͓ͦΒ࣍͘ͷWWDCͰ͸ɺHomePod΁ͷΞϓ ϦରԠ͕ൃද͞ΕΔ͸ͣɻ ▸ HomePodʹରԠͰ͖Δͷ͸ɺSiriKitʹରԠͯ͠ ͍ΔΞϓϦʹͳΔͰ͠ΐ͏ɻ
  18. HOW TO SIRIKIT

  19. SIRIKIT AND ME FRAMEWORK FOR SIRIKIT ▸ ࣮͸ SiriKit ͱ͍͏ϑϨʔϜϫʔΫ͸͋Γ·ͤΜɻ

    ▸ Intents SiriKitͷϩδοΫ෦෼Λ୲౰͢ΔϑϨʔϜϫʔΫ ▸ Intents UI SiriKitͷUI෦෼Λ୲౰͢ΔϑϨʔϜϫʔΫ
  20. SIRIKIT AND ME ADD INTENTS TARGET ▸ Host AppΛ࡞ΓɺͦΕʹ Intents

    λʔήοτΛ௥Ճ͠·͢ɻ
  21. SIRIKIT AND ME ADD CODES TO TARGET ▸ IntentsϑϨʔϜϫʔΫΛ௥Ճ͢Δͱɺ௥Ճ͞ΕͨϑΝΠϧͷதʹ Message

    IntentsʹରԠ͢ΔͨΊͷαϯϓϧίʔυ͕ॻ͍ͯ͋Γ·͢ɻMessage Intents ͩͬͨΒɺ͜Εʹ͕ͨͬͯ͠هड़͢Ε͹େৎ෉Ͱ͢ɻ ▸ ΄͔ͷIntentsͷ৔߹ʹ͸ɺରԠ͢ΔΫϥεΛ࣮૷͠·͢ɻ ▸ ͦͷIntents Target͕ͲͷIntentsʹରԠ͢Δͷ͔͸IntentsͷInfo.plistΛࢀরͯ͘͠ ͍ͩ͞ɻ
  22. STRUGGLE WITH SIRIKIT

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

  24. SIRIKIT AND ME EXTENSION ▸ SiriKit͸App ExtensionͷҰछͰ͢ɻ ▸ App Extension͸iOS8͔Β঺հ͞ΕͨɺγεςϜͷػೳΛݸผͷΞϓϦͰ֦ு͢

    ΔͨΊͷ࢓૊ΈͰ͢ɻ ▸ Today ExtensionɺCusom KeyboardɺͳͲɺiOS11Ͱ͸23ݸ΋ͷApp Extension ͕͋Γ·͢ɻ
  25. SIRIKIT AND ME EXTENSION ▸ App Extension͸ɺΞϓϦͷ഑෍࣌ʹ͸ Host App ͷBundleʹؚ·Ε·͢ɻ

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

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

  28. SIRIKIT AND ME EXTENSION - MEMORY ▸ ·ͣɺAppleͱ Orangeͱ͍͏ೋͭͷΞϓϦΛ࡞Γ·͢ɻ ▸

    AppleΞϓϦͰɺIntϙΠϯλΛ֬อ͠ɺͦ͜ʹʮ12345ʯΛ͍Ε·͢ɻ ▸ ͦͷIntϙΠϯλͷΞυϨε஋Λه࿥ɻ let ApplePtr = UnsafeMutablePointer<Int>.allocate(capacity:1) ApplePtr.pointee = 12345 let AppleValue = ApplePtr.pointee print(ApplePtr) // 0x00000001c0013570 print(AppleValue) // 12345
  29. SIRIKIT AND ME EXTENSION - MEMORY ▸ OrangeΞϓϦΛىಈ͠·͢ɻʢApple ΞϓϦ͸όοΫάϥ΢ϯυঢ়ଶͱͳΓ· ͢ʣ

    ▸ ͦ͜Ͱɺ͖͞΄ͲAppleΞϓϦͰ֬อͨ͠IntϙΠϯλͷத਎Λ֬ೝɻ ▸ த਎͸ʮ0ʯͱͳΓ·͢ɻʢ͖͞΄ͲAppleΞϓϦ಺Ͱ֬ೝͨ͠஋͸ʮ12345ʯͰ ͨ͠ɻʣ var orangePtr = UnsafeMutablePointer<Int>.allocate(capacity:1) // + or - orangePtr and make it to 0x00000001c0013570 let orangeValue = orangePtr.pointee
  30. SIRIKIT AND ME EXTENSION - MEMORY ▸ ଞͷϓϩηεͰ֬อͨ͠ϝϞϦʹ͍ͭͯ͸ɺͨͱ͑ͦͷΞυϨε͕Θ͔͍ͬͯͯ ΋஋Λࢀর͢Δ͜ͱ͸Ͱ͖·ͤΜɻ ▸

    App Extention͸Host Appͱҧ͏ϓϩηεͷͨΊɺϝϞϦʔ্ͷ৘ใΛڞ༗Ͱ͖ ·ͤΜɻ ▸ ExtensionͷҰछͰ͋ΔIntents΋ɺಉ༷ʹ HostApp ͱϝϞϦʔঢ়ͷ৘ใΛڞ༗͢ Δ͜ͱ͸Ͱ͖·ͤΜɻ
  31. SIRIKIT AND ME EXTENSION - MEMORY ▸ ϝϞϦʔ্ͷ৘ใڞ༗͕Ͱ͖ͳ͍৔߹ɺͲ͏΍ͬͯHost Appͱ৘ใΛڞ༗͢Δ ͔ɻ

    ▸ →ϑΝΠϧΩϟογϡΛ࢖͍·͢ɻ
  32. SIRIKIT AND ME EXTENSION - FILE STORAGE ▸ iOSͰ͸ɺϑΝΠϧγεςϜ্ʹ Sandboxͱ͍͏࢓૊Έ͕͋ΓɺҰͭͷΞϓϦͷ

    File Storage͸ଞͷΞϓϦ͔ΒݟΔ͜ͱ͕Ͱ͖·ͤΜɻ ▸ ࣮͸ɺExtension΋ଞͷΞϓϦͱಉ͡ѻ͍ͱͳΓɺHost AppͷFile StorageͱApp ExtensionͷFile Storage͸ҧ͏৔ॴͱͳΓɺޓ͍ʹΞΫηε͢Δ͜ͱ͸Ͱ͖·ͤ Μɻ
  33. SIRIKIT AND ME EXTENSION - FILE STORAGE ▸ ͦ͜Ͱɺڞ௨ʹ࢖͑ΔFile Storageͱͯ͠ɺApp

    GroupΛར༻͠·͢ɻ ▸ App Group͸ɺಉ͡DeveloperͷΞϓϦͲ͏͠Ͱಉ͡File StorageΛڞ༗͢Δ࢓ ૊ΈͰ͢ɻ ▸ App GroupͰΞϓϦؒσʔλڞ༗ ▸ http://www.toyship.org/archives/1845
  34. SIRIKIT AND ME TIMEOUT ERROR ▸ Siri͸ϢʔβʔʹࣗવʹԠ౴͠ͳͯ͘͸͍͚ͳ͍ͨ ΊɺSiriKitͷॲཧʹ͸λΠϜΞ΢τ੍ݶ͕͋Γ· ͢ɻ ▸

    ϩδοΫॲཧɺϏδωεॲཧʹ࣌ؒΛ͔͚Δ͜ͱ ͕Ͱ͖·ͤΜɻ ▸ ͕͔͔࣌ؒΔωοτϫʔΫॲཧͳͲ͸ɺϑΝΠϧ ΩϟογϡͳͲΛ࢖ͬͯϨεϙϯε࣌ؒΛ୹͘͢ Δ͜ͱ΋༗ޮɻ
  35. SIRIKIT AND ME INTERNAL SERVER ERROR ▸ SiriKitͷIntentsϑϨʔϜϫʔΫͷΤϥʔ৘ใऔಘ͕ ೉͍͠ ▸

    ໌֬ͳΤϥʔʢΤϥʔίʔυͳͲʣ͕ؼͬͯ͜ ͳ͍͜ͱ͕ଟ͍ɻʮ୯ʹࣦഊͨ͠ʯͱͳͬͯ͠ ·͏ͨΊɺσʔλͷϑΥʔϚοτΤϥʔͳͷ͔ɺ ϓϩύςΟʔͷΤϥʔͳͷ͔Θ͔Γ·ͤΜɻ ▸ SiriKitͷϑϨʔϜϫʔΫͷग़͢ϩάΛݟΕ͹൑໌ ͢ΔͷͰɺͦΕΛ֬ೝͨ͠΄͏͕͍͍Ͱ͠ΐ͏ɻ
  36. SIRIKIT AND ME CHANGE ON VERSIONUP ▸ iOSͷόʔδϣϯΞοϓͰϨεϙϯε͕ҟͳΔ͜ͱ͕͋Γ· ͢ɻ ▸

    iOSͷϚΠφʔόʔδϣϯΞοϓͰϓϩύςΟ͕͠Εͬͱ ૿ݮ͍ͯͨ͠ΓɺγεςϜ͕දࣔ͢ΔUI͕ҧͬͨΓ……ɻ ▸ ࣗ෼ͷίʔυ͸શ͘ม͑ͯͳ͍ͷʹಈ࡞͕มΘͬͯ͠·͏͜ ͱ΋͋Γɺ৺ͷ҆ఆΛอͯͳ͍͜ͱ΋͋Γ·͢ɻ ▸ ՄೳͰ͋Ε͹ɺγεςϜ͔ΒͷϨεϙϯεͷө૾΋ؚΊͨه ࿥Λ࢒͓ͯ͘͠ͱɺଟগ҆৺࣮ͯ͠૷͕͢͢ΊΒΕ·͢ɻ
  37. SIRIKIT AND ME BUGS ON LANGUAGES ▸ AppleͰ͸SiriKitؔ࿈ͷػೳͷݕূ͸ӳޠΛத৺ʹߦΘΕ͍ͯ·͢ɻ ▸ ೔ຊޠͳͲɺӳޠҎ֎ͷݴޠͰಈ࡞ͤ͞Δͱɺҙਤͨ͠ಈ࡞ʹͳΒͳ͍͜ͱ΋͋

    Γ·͢ɻ ▸ ྫ͑͹ɺࣸਅݕࡧͷIntentsͰ͸ɺ೔ຊޠͷ৔߹ʹจࣈྻ͕ద੾ʹ౉͞Εͳ͍ό άͳͲ͕͋Γ·͢ɻ ▸ SiriKit࣮૷࣌ʹ͸ӳޠ؀ڥͰ֬ೝ͢Δ͜ͱ΋ඞཁɻ
  38. SIRIKIT AND ME HOW I STRUGGLE WITH SIRIKIT ▸ ࠓ೔ͷࢿྉͰޠΓ͖Εͳ͔ͬͨSiriKitͷ࣮૷ͷ

    TipsͳͲΛͪ͜ΒͰઆ໌͍ͯ͠·͢ɻ ▸ How I struggle with SiriKit. ▸ https://speakerdeck.com/toyship/how-i- struggle-with-sirikit
  39. SIRIKIT AND ME ·ͱΊ ▸ SiriKit͸࣮૷ྔ͸গͳ͍Ͱ͕͢ɺσόοά࣌ʹ ৐Γӽ͑ͳͯ͘͸͍͚ͳ͍น͕ඇৗʹߴ͘ɺ 10೥ͷiOSܦݧͰҰ൪ͭΒ͍࣮૷Ͱͨ͠ɻ ▸ Ͱ΋HomePodରԠͳͲɺ৽͍͜͠Ε͔Βͷํ

    ޲ੑΛͻΒ͘΋ͷͳͷͰɺͥͻ࢖ͬͯΈͯͩ͘ ͍͞ɻ
  40. TEXT ▸ ϥϯνͷ͓ళ༧໿ͯ͠ ▸ ΠλϦΞϯͰ ▸ ໌೔ͷ͔̍̎࣌̏̌Β ▸ ਓ਺͸ೋਓ ▸

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

    ˎ͞Μͱͷϥϯν͸લճ΋͜ͷళ͔ͩͬͨΒ͜͜ʹ͠Α͏ ▸ ʮ͸͍ɻˎˎͰ12:30͔Β໊̎Ͱ༧໿Ͱ͖·ͨ͠ɻʯ
  42. TEXT ▸ طଘͷϏδωεϩδοΫ͋Θ࣮ͤͯ૷Λ͢Δ ▸ ϏδωεϩδοΫʹ͋ΘͤͯϢʔβʔʹೖྗͤ͞Δ ▸ ͷͰ͸ͳ͘ɻ ▸ Ϣʔβʔͷཧ૝ͷUXʹϏδωεϩδοΫͱ࣮૷Λ͋Θ͍ͤͯ͘౒ྗΛ͢Δɻ