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
420
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
460
オンライン英会話アプリとSkyWay
taminif
0
410
iOS11は本当にWebRTCに対応したのか
taminif
1
1.3k
Other Decks in Programming
See All in Programming
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
430
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.2k
Jakarta EE meets AI
ivargrimstad
0
150
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
5
2.2k
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
Figma Dev Modeで変わる!Flutterの開発体験
watanave
0
150
Jakarta EE meets AI
ivargrimstad
0
230
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
200
みんなでプロポーザルを書いてみた
yuriko1211
0
280
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
610
OnlineTestConf: Test Automation Friend or Foe
maaretp
0
120
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
Into the Great Unknown - MozCon
thekraken
32
1.5k
Happy Clients
brianwarren
98
6.7k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Making Projects Easy
brettharned
115
5.9k
BBQ
matthewcrist
85
9.3k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
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։࠵ͯ͠Δ͔ΒདྷͯͶʂ
ྑ͍αʔϏεͰɺྑ͍ਓੜΛ
͋Γ͕ͱ͏͍͟͝·ͨ͠