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
410
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
2.1k
Redashの開発はじめました / How to get started Redash development
taminif
0
720
私の生活を変えたHeadless Chrome / Headless Chrome who changed my life
taminif
3
430
WebSocketをiOSに持ち込んで辛い思いをした経験がありますか!? / have you painful experience in web socket?
taminif
3
5.4k
LINEで馬券を購入する / Purchase a betting ticket at LINE
taminif
1
1.5k
SkyWayで一年間運用してきたけどWebRTCってつらいんじゃないの
taminif
2
960
オンライン英会話とSkyWay
taminif
0
460
オンライン英会話アプリとSkyWay
taminif
0
410
iOS11は本当にWebRTCに対応したのか
taminif
1
1.3k
Other Decks in Programming
See All in Programming
42 best practices for Symfony, a decade later
tucksaun
1
180
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
130
Haze - Real time background blurring
chrisbanes
1
510
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
550
testcontainers のススメ
sgash708
1
120
Monixと常駐プログラムの勘どころ / Scalaわいわい勉強会 #4
stoneream
0
280
Security_for_introducing_eBPF
kentatada
0
110
tidymodelsによるtidyな生存時間解析 / Japan.R2024
dropout009
1
790
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
1.2k
これでLambdaが不要に?!Step FunctionsのJSONata対応について
iwatatomoya
2
3.7k
Go の GC の不得意な部分を克服したい
taiyow
3
790
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
110
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Agile that works and the tools we love
rasmusluckow
328
21k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
111
49k
Faster Mobile Websites
deanohume
305
30k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
A designer walks into a library…
pauljervisheath
204
24k
Automating Front-end Workflow
addyosmani
1366
200k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
KATA
mclloyd
29
14k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.2k
The Language of Interfaces
destraynor
154
24k
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։࠵ͯ͠Δ͔ΒདྷͯͶʂ
ྑ͍αʔϏεͰɺྑ͍ਓੜΛ
͋Γ͕ͱ͏͍͟͝·ͨ͠