Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SiriKit and Me

Tachibana Kaoru
September 15, 2017

SiriKit and Me

iOSDC2017

Tachibana Kaoru

September 15, 2017
Tweet

More Decks by Tachibana Kaoru

Other Decks in Technology

Transcript

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

    ϘϧμϦϯά͕޷͖Ͱɺ࠷ۙ͸ϦʔυΫϥΠϛϯά ΋νϟϨϯδதɻ ▸ Blog : http://www.toyship.org/
  2. SIRIKIT AND ME SIRIKIT ▸ iOS10͔Β ▸ Siri ΍ Map

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

    Payments ▸ Lists and Notes ▸ Visual Codes ▸ Photos ‣ Workouts ‣ Ride Booking ‣ Car Commands ‣ CarPlay ‣ Restaurant Reservation
  4. SIRIKIT AND ME HOMEPOD ▸ ݱঢ়Ͱ͸HomePodʹΞϓϦରԠ͸ൃද͞Ε͍ͯ ·ͤΜ͕ɺᗐ྽ͳઓ͍͕܁Γ޿͛ΒΕ͍ͯΔε ϚʔτεϐʔΧʔքͰɺαʔυύʔςΟʔ੡ͷ๛ ෋ͳΞϓϦʹରԠͰ͖Δར఺͸େ͖͍ɻ ▸

    ͓ͦΒ࣍͘ͷWWDCͰ͸ɺHomePod΁ͷΞϓ ϦରԠ͕ൃද͞ΕΔ͸ͣɻ ▸ HomePodʹରԠͰ͖Δͷ͸ɺSiriKitʹରԠͯ͠ ͍ΔΞϓϦʹͳΔͰ͠ΐ͏ɻ
  5. SIRIKIT AND ME FRAMEWORK FOR SIRIKIT ▸ ࣮͸ SiriKit ͱ͍͏ϑϨʔϜϫʔΫ͸͋Γ·ͤΜɻ

    ▸ Intents SiriKitͷϩδοΫ෦෼Λ୲౰͢ΔϑϨʔϜϫʔΫ ▸ Intents UI SiriKitͷUI෦෼Λ୲౰͢ΔϑϨʔϜϫʔΫ
  6. SIRIKIT AND ME ADD CODES TO TARGET ▸ IntentsϑϨʔϜϫʔΫΛ௥Ճ͢Δͱɺ௥Ճ͞ΕͨϑΝΠϧͷதʹ Message

    IntentsʹରԠ͢ΔͨΊͷαϯϓϧίʔυ͕ॻ͍ͯ͋Γ·͢ɻMessage Intents ͩͬͨΒɺ͜Εʹ͕ͨͬͯ͠هड़͢Ε͹େৎ෉Ͱ͢ɻ ▸ ΄͔ͷIntentsͷ৔߹ʹ͸ɺରԠ͢ΔΫϥεΛ࣮૷͠·͢ɻ ▸ ͦͷIntents Target͕ͲͷIntentsʹରԠ͢Δͷ͔͸IntentsͷInfo.plistΛࢀরͯ͘͠ ͍ͩ͞ɻ
  7. SIRIKIT AND ME EXTENSION ▸ SiriKit͸App ExtensionͷҰछͰ͢ɻ ▸ App Extension͸iOS8͔Β঺հ͞ΕͨɺγεςϜͷػೳΛݸผͷΞϓϦͰ֦ு͢

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

    ▸ ͔͠͠ɺApp Extensionͷϓϩηε͸ɺHost Appͱ͸ผʹͳΓ·͢ɻ
  9. 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
  10. 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
  11. SIRIKIT AND ME EXTENSION - MEMORY ▸ ଞͷϓϩηεͰ֬อͨ͠ϝϞϦʹ͍ͭͯ͸ɺͨͱ͑ͦͷΞυϨε͕Θ͔͍ͬͯͯ ΋஋Λࢀর͢Δ͜ͱ͸Ͱ͖·ͤΜɻ ▸

    App Extention͸Host Appͱҧ͏ϓϩηεͷͨΊɺϝϞϦʔ্ͷ৘ใΛڞ༗Ͱ͖ ·ͤΜɻ ▸ ExtensionͷҰछͰ͋ΔIntents΋ɺಉ༷ʹ HostApp ͱϝϞϦʔঢ়ͷ৘ใΛڞ༗͢ Δ͜ͱ͸Ͱ͖·ͤΜɻ
  12. SIRIKIT AND ME EXTENSION - FILE STORAGE ▸ iOSͰ͸ɺϑΝΠϧγεςϜ্ʹ Sandboxͱ͍͏࢓૊Έ͕͋ΓɺҰͭͷΞϓϦͷ

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

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

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

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

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

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

    TipsͳͲΛͪ͜ΒͰઆ໌͍ͯ͠·͢ɻ ▸ How I struggle with SiriKit. ▸ https://speakerdeck.com/toyship/how-i- struggle-with-sirikit