Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Mac1台でアプリを作る時代再び
Search
taminif
November 09, 2017
Programming
0
400
Mac1台でアプリを作る時代再び
Osaka Mix Leap Study #1 - Android / iOSで発表した資料です。
taminif
November 09, 2017
Tweet
Share
More Decks by taminif
See All by taminif
PuppeteerとPlaywrightの15日間の演劇 / relation of Puppeteer and Playwright
taminif
3
2k
Redashの開発はじめました / How to get started Redash development
taminif
0
710
私の生活を変えたHeadless Chrome / Headless Chrome who changed my life
taminif
3
410
WebSocketをiOSに持ち込んで辛い思いをした経験がありますか!? / have you painful experience in web socket?
taminif
3
5.3k
LINEで馬券を購入する / Purchase a betting ticket at LINE
taminif
1
1.5k
SkyWayで一年間運用してきたけどWebRTCってつらいんじゃないの
taminif
2
950
オンライン英会話とSkyWay
taminif
0
450
オンライン英会話アプリとSkyWay
taminif
0
400
iOS11は本当にWebRTCに対応したのか
taminif
1
1.3k
Other Decks in Programming
See All in Programming
Kaigi on Rails 2024 - Rails APIモードのためのシンプルで効果的なCSRF対策 / kaigionrails-2024-csrf
corocn
5
3.4k
EventSourcingの理想と現実
wenas
6
2.1k
Kubernetes for Data Engineers: Building Scalable, Reliable Data Pipelines
sucitw
1
200
外部システム連携先が10を超えるシステムでのアーキテクチャ設計・実装事例
kiwasaki
1
230
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
140
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
1
250
弊社の「意識チョット低いアーキテクチャ」10選
texmeijin
5
23k
RailsのPull requestsのレビューの時に私が考えていること
yahonda
5
1.7k
From Subtype Polymorphism To Typeclass-based Ad hoc Polymorphism- An Example
philipschwarz
PRO
0
170
cXML という電子商取引の トランザクションを支える プロトコルと向きあっている話
phigasui
3
2.3k
カスタムしながら理解するGraphQL Connection
yanagii
1
1.2k
推し活の ハイトラフィックに立ち向かう Railsとアーキテクチャ - Kaigi on Rails 2024
falcon8823
6
2.2k
Featured
See All Featured
A designer walks into a library…
pauljervisheath
202
24k
Making Projects Easy
brettharned
115
5.9k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
7
150
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
Automating Front-end Workflow
addyosmani
1365
200k
StorybookのUI Testing Handbookを読んだ
zakiyama
26
5.2k
The Cult of Friendly URLs
andyhume
78
6k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
355
29k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.2k
Transcript
Mac1Ͱ ΞϓϦΛ࡞Δ࣌࠶ͼ Osaka Mix Leap Study #1 - Android /
iOS 2017/11/09 େౡ ޫو@sbntaminif
ࣗݾհ • ΣϒϦΦגࣜձࣾWEBΤϯδχΞ + ϓϩμΫτ Ϛωʔδϟʔ • ฏWEBΞϓϦɺٳiOSΞϓϦΛͬͯ·͢ • WebRTC
Meetup Osakaओ࠵ • ීஈژͰಇ͍͍ͯ·͢
http://ejje.weblio.jp/content/ios
iOSDC 2017Ͱొஃ͖ͯ͠·ͨ͠ ຊ༰ͪΐͬͱඃͬͯ·͢ https://speakerdeck.com/taminif/ ying-hui-hua-sabisufalsetamenikai- fa-sitabideotiyatutoapurifalseji-shu
λΠτϧʹʮ࣌ʯͱ͋ΔͷͰ ·ͣྺ࢙
ΞϓϦ։ൃͷྺ࢙ ʢݸਓͷओ؍Ͱ͢ʣ • γϯϓϧͳҰػೳΞϓϦ • ίϯγϡʔϚʔҠ২ͷΑ͏ͳങ͍ΓܕΞϓϦ • αʔόʔͱͷ࿈ܞΛඞཁͱ͍ͯ͠ΔΞϓϦ ϝϞి γϯϓϧͳήʔϜ
ιγϟή ϘʔυήʔϜͷରઓܕ Ϋϥυܥ
ࠓͱʹ͔͘αʔόʔͱͷ ࿈ܞ͕ඞཁ ͦͷͨΊʹαʔόʔΛ ༻ҙ͢Δඞཁ͕͋Δ
αʔόʔ͕͍Δʂ
αʔόʔΛ༻ҙ͢Δͷ ΞϓϦ։ൃऀʹͱَͬͯ
ͦ͜ͰɺαʔόʔϨε
ͦ͜ͰɺFirebase • FirebaseGoogle͕ఏڙ͢ΔmBaaS • iOS, Android, ΣϒͰ༻Մೳ • ։ൃΛॿ͚Δଟ͘ͷػೳ͕͋Γ·͢ɻ
ͦ͜ͰɺFirebase • ࣗͰαʔόʔΛ༻ҙ͢ΔΑΓ҆Ձ • Ұఆͷ௨৴·ͰແྉͰ͑Δ • Google͕ӡӦ͢Δ͚ͩ͋ͬͯ΄ͱΜͲམ ͪͳ͍ • ೖΕΔ͚ͩͰଟ͘ͷػೳΛΧόʔ͢Δ
ଟ͘ͷΞϓϦ։ൃऀ͕ ͍ͯ͠Δʂʂ
FirebaseΛΞϓϦʹ ΈࠐΜͰΈΑ͏
͜͜ͰɺνϟοτΞϓϦ Λྫʹߟ͑ͯΈ·͢
ͦͷલʹɾɾɾ FirebaseΛΞϓϦʹΈࠐ Ή͜ͱͰԿ͕࣮ݱͰ͖Δ͔
͜͏ͳΔ • Կ͠ͳͯ͘Analytics͕Έࠐ·ΕΔ • CrashϩάΛݟΔ͜ͱ͕Ͱ͖Δ • ϓογϡ௨ΛૹΔ͜ͱ͕Ͱ͖Δ • NEW! A/BςετΛߦ͏͜ͱ͕Ͱ͖Δ
શͯΛΓ͍ͨํ ԼهURL https://firebase.google.com/products/?hl=ja
νϟοτΞϓϦʹ Realtime Database • ΫϥυͰϗεςΟϯά͞ΕΔDB • JSONͰอଘ͞ΕɺπϦʔߏͰߏங • શͯͷΫϥΠΞϯτͰಉظ͞ΕΔ •
ΦϑϥΠϯ/ΦϯϥΠϯͷΓସ͑ରԠ
Realtime DatabaseΛͬ ͯνϟοτΛ࣮
Realtime DatabaseͷΈ 'JSFCBTFαʔό ᶄ3FBMUJNF%BUBCBTFʹ ॻ͖ࠐΈ ᶅॻ͖ࠐ·Εͨ༰Λ ௨ ᶃࢦఆͨ͠ύεΛ ࢹ͢ΔΑ͏ઃఆ
νϟοτͷ࣮ݱ ,FZ7BMVFͰΛอଘ औಘ͢Δࡍ+40/ܗ ࣜͰऔಘͰ͖Δ ҰͭͷϊʔυͰҰͭͷνϟοτΛ ࣮ݱ͍ͯ͠Δ ࣌ܥྻॱʹฒΔ͜ͱͰνϟοτͬΆ͘ දࣔ
Realtime Database let withBlock = { (snapshot: FIRDataSnapshot) in //
received chat data if let dictionary = snapshot.value as? [String : AnyObject] { guard let isRoleProf = dictionary["is_role_prof"] as? Bool, let timeMsec = dictionary["time_msec"] as? UInt64, let senderIdString = dictionary["sender_id"] as? String, let senderId = Int(senderIdString), let text = dictionary["text"] as? String else { return } let time:Double = Double(timeMsec) / 1000 } var data:ChatDataStruct if isRoleProf { // prof data = ChatDataStruct(messageSender: .YOU, message: text, displayTime: self.displayTimeFormatter.string(from: Date(timeIntervalSince1970: time))) } else { // member data = ChatDataStruct(messageSender: .ME, message: text, displayTime: self.displayTimeFormatter.string(from: Date(timeIntervalSince1970: time))) } self.chatTableReload(data: data) } firebaseChatObserveHandle = firebaseUserReference.child(`Firebaseͷύε `).observe(.childAdded, with: withBlock) ՃࣜͰ0CTFSWFS ηοτ 'JSFCBTF͔Βϊʔ υΛड͚औͬͨ࣌ ͷॲཧΛఆٛ
ͪΐͬͱઢ
νϟοτػೳWebRTCΛ ࣮ͬͯݱͰ͖·͢ WebRTCͱɾɾɾ • W3C͕ఏএ͢ΔP2PϦΞϧλΠϜίϛϡχέʔ γϣϯΛ࣮ݱ͢Δٕज़ • ϓϥάΠϯͳ͠ͰϒϥβؒͷΓͱΓ͕Մೳ • ςΩετόΠφϦͳͲͷσʔλܗࣜө૾
ԻͳͲͷStreamܗࣜͷΓͱΓ͕Մೳ
WebRTCͷΈ ᶅ௨৴ʂ 456/563/ ʢதܧʣαʔό γάφϦϯά αʔό ᶃ ᶄ ᶄ ᶃ
ͪ͜ΒɺαʔυύʔςΟ͕ ͋ΔͷͰແྉͰ࣮Ͱ͖·͢
͡Ό͋ɺͲͬͪΛ͑ ྑ͍ͷʁ
3ͭͷ؍Ͱબ͢Δͷ͕ྑ͍ • MVP • νϟοτҎ֎ͷՃՁ • ͍ͣΕαʔϏε֦େͨ͠߹ͷ ίετύϑΥʔϚϯε
MVP • Minimum Viable Product • ϦʔϯελʔτΞοϓΛ࣮ߦ͢Δͨ Ίͷखஈ • ελʔτΞοϓʹ͔ܽͤͳ͍ߟ͑ํ
• ࣗʹͱͬͯ࠷খݶͷίετͰʂ
νϟοτҎ֎ͷՃՁ • Firebaseઆ໌ͨ͠௨Γ • WebRTCͩͱϏσΦνϟοτ࣮ Ͱ͖Δ • ଞʹ͚͍ͭͨػೳͰߟ͑Δʂ
αʔϏε֦େ࣌ • ͲͪΒ༻ྔ͕૿͑Δͱ͓͕͔ۚ ͔Δ • ༻ਓμϯϩʔυྔͳͲ • Ͳ͜·Ͱ͓͕͔͔͑ۚΔ͔Λܭ ࢉ͠Α͏ʂ
·ͱΊ
·ͱΊ • Firebaseྑ͍Αʂ • ͱʹ͔͘Կ͔࡞Ζ͏ʂ • WebRTCྑ͍Αʂ • େࡕͰMeetup։࠵ͯ͠Δ͔ΒདྷͯͶʂ
ྑ͍αʔϏεͰɺྑ͍ਓੜΛ
͋Γ͕ͱ͏͍͟͝·ͨ͠