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

パラレルの通話を支える iOS アプリ上での技術

パラレルの通話を支える iOS アプリ上での技術

Naoki ISHIKAWA

July 30, 2021
Tweet

More Decks by Naoki ISHIKAWA

Other Decks in Technology

Transcript

  1. Copyright © Parallel Inc. All Rights Reserved. ༑ୡͱ༡΂Δ௨࿩ΞϓϦʮύϥϨϧʯ 6 App

    Store ධՁɿ4.7/5.0ʢ 2.3ສ݅ʣ ύϥϨϧ͸஥ͷྑ͍༑ୡͱ௨࿩Λܨ͗ͳ͕ΒɺήʔϜͨ͠ΓಈըΛݟͨΓͯ͠༡΂Δ௨࿩ΞϓϦͰ͢ ᶃ ๛෋ͳ௨࿩ػձͷ૑ग़ • ༑ୡͷεςʔλεදࣔ • ؆୯ελϯϓΞΫγϣϯ • ௨࿩։࢝࣌ͷϓογϡ௨஌ ᶄ ࠷దͳ௨࿩؀ڥ • ݸผʹ௨࿩ԻྔΛௐ੔Մೳ • ѹ౗తʹ௿஗Ԇͳ௨৴ ᶅ εϚϗ࠷దԽ͞ΕͨUI/U X • ొ࿥͸10ඵͰ׬ྃ • ࢖͍׳ΕͨUI/UXͰ͙͢ʹ࢖͑Δ ᶆ Ұॹʹ༡΂ΔύʔςΟʔίϯςϯπ • αΫοͱ༑ୡͱ༡΂Δίϯςϯπ͕๛෋ • ϘλϯҰͭͰڞಉମݧ͕Մೳ
  2. WebSocket ֓ཁ • ௨࿩࣌ • background ਐೖ࣌΋઀ଓΛܧଓ • background mode:

    audio Λࢦఆ͍ͯ͠ΔͷͰɺ௨࿩த͸ background Ͱ΋ main thread ͷϥϯϧʔϓ͸ܧଓ͢ΔͨΊ • ඇ௨࿩࣌ • background ਐೖ࣌ʹ੾அɺforeground ʹ໭ͬͨ࣌ʹ઀ଓ 11
  3. WebSocket ֓ཁ • ௨࿩࣌ • background ਐೖ࣌΋઀ଓΛܧଓ • background mode:

    audio Λࢦఆ͍ͯ͠ΔͷͰɺ௨࿩த͸ background Ͱ΋ main thread ͷϥϯϧʔϓ͸ܧଓ͢ΔͨΊ • ඇ௨࿩࣌ • background ਐೖ࣌ʹ੾அɺforeground ʹ໭ͬͨ࣌ʹ઀ଓ 12
  4. WebSocket background Ͱ௨࿩தʹ੾Εͯ͠·͏ݪҼͱରॲํ๏ • ݪҼ • background ௨࿩தʹ௨৴͕ Cellular <->

    WiFi Ͱมߋ͞Εͨͱ͖ • ରॲ • heartbeat(ping/pong) ͷಋೖ • ఆظతʹ Timer Λ࢖ͬͯૄ௨֬ೝ 13
  5. Unity as a Library • ʲUnityʳMirrativͷEmbedding UnityΛߋ৽ͨ͠࿩: ࣮ફ Unity as

    a Library • ͪ͜ΒΛࢀߟʹΞϓϦʹ݁߹ • ੒Ռ෺ UnityFramework.framework Λ repos ʹ push ͢Δ • ͦͷ repos Λ submodule ͰऔΓࠐΉ ؀ڥߏங 17
  6. Unity as a Library • Unity ͸ UIWindow Λ΋͏Ұͭ࡞੒͍ͯ͠Δ •

    Unity ͱ app ͷ window Λަޓʹ makeKeyAndVisible ͠ͳ͕Βը໘ભҠ • Unity ͷ view ্ʹɺUIViewController ΛΦʔόʔϨΠ͍ͤͯ͞Δ • Unity -> Native ͷϝοηʔδϯά • Unity ͷதʹ NativeCallsProxy protocol Λఆٛ • ͦΕʹద߹ͨ͠ object ΛΞϓϦଆͰ `FrameworkLibAPI.registerAPIforNativeCalls` ݺ ͼग़͠ొ࿥ ࣮૷ 18
  7. Unity as a Library • େมͳͱ͜Ζ • όΠφϦαΠζ͕େ͖͘ͳΔ • Unity

    ݻ༗ͷΫϥογϡ͕ൃੜ͢Δ • Ϋϥογϡϩάͷղੳ͕೉͍͠ ࣮૷ 19
  8. Broadcast Extension • ը໘ڞ༗ʹ༻͍Δ • ReplayKit (2) Λ࢖༻ • 2

    ͔ΒγεςϜඪ४ͷUIΛ࢖ͬͯɺ୺຤ʹөΔը໘Λ഑৴Ͱ͖ΔΑ͏ʹ • Կ͔ͱෆ҆ఆ • Invalid broadcast session Ͱݕࡧ͢Δͱɺը໘ڞ༗Λαϙʔτ͍ͯ͠Δ ΞϓϦ͕Θ͔Δ ֓ཁ 20
  9. Broadcast Extension • App <-> Broadcast Extension ؒͷΠϕϯτ௨஌͕೉͍͠ • ࣮ࡍͷը໘ڞ༗ͷ։࢝ͱऴྃΛΞϓϦଆͰ஌Γ͍ͨ

    • capturedDidChangeNoti fi cation ΍ UIScreen.isCaptured ͸͋Δ • ͜Εͩͱը໘ڞ༗͚ͩͰͳ͘ɺ࿥ը΍ AirPlay ΋ର৅ʹͳͬͯ͠·͏ • App Group ܦ༝ͰϑϥάΛड͚౉͍ͯ͠Δ(!!!) ࣮૷ 21