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
    2017/9/15
    IOSDC 2017

    View full-size slide

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

    View full-size slide

  3. WHAT IS SIRIKIT?

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  11. WHY SIRIKIT?

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  17. HOW TO SIRIKIT

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  21. STRUGGLE WITH
    SIRIKIT

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  27. 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

    View full-size slide

  28. 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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide