Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
RN分享
Search
passol1988
March 11, 2017
Programming
26
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
RN分享
passol1988
March 11, 2017
Transcript
14 slides
RNړՁ எူ
ᙧวՕᕨ 1.ଘݣ,write once, run anywhere 2.ڹᒒ֛ḵӧ֯ 3.ๅො᧣አܻኞ 4.ᅾๅෛ
ᵱᥝഩൎጱचᏐᎣᦩ 1.ਞܓݎ 2.OCݎ 3.Javascript 4.ES6,Redux,Flexbox,React-Nativeຝ ᗌᅩ: 1.ଚӧᚆਠقଘݣ҅᮱ړᬮฎᵱᥝᕣᒒᯈݳ 2.ֵአ᮱ړᕟկՖᆐํࣗ 3.fbஉݢᚆӧᖌಷ 4.ᅾๅෛ(codePush)ጱ๐ۓஙጱ҅ํݢᚆӧᑞਧ
֢አ ES6 ᒫӣොପ React-Native iOS Android
ፓ୯ᕮ index.ios.js:iOSጱفݗկ node_modules:npmᓕቘጱପկ package.json:ᶱፓׁᩢկ js:ᶱፓկ resource:ᶱፓᩒრկ app.json:(ݢᭌ)
ݎሾह൫ୌ 1.ݎૡٍ brew install node //nodeሾह npm install -g yarn
react-native-cli //rnե brew install watchman //ਫፊၥկݒ۸ 2.Xcode react-native init ᶱፓݷ ݢզಋۖ Ԟݢզکᶱፓ᪠ஆӥreact-native run-ios
ಋۖᵞ౮ 1.package.jsonץදଚnpm install 2.ֵአcocoapodsىᘶ 1) فૡᑕ,link libraries 2҂ץදheader አ᪠ஆ 3)
ᚕ๊ഘ #import <React/(.*)> #import "$1"
ኞޮ๗ ত getDefaultProps getInitialSatte componentWillMount render componentDidMount ᬩᤈӾ ંpropsදݒ componentWillReceiveProps
stateදݒ shouldComponentUpdate componentWillUpdate render componentDidUpdate ܬ componentWillUnmount ᕮ ฎ ވ
Debug 1.ސۖݸݣ๐ۓ 2.ᬩᤈXcode 3.Cmd+R᯿ෛڬෛ,Cmd+D᧣᩸᧣ᦶោܔ
ᅾๅෛ(CodePush) 1.ਞᤰڠୌဳٙ npm install -g code-push-cli code-push register code-push login
code-push app add ᶱፓݷ 2.ႲےSDK nam install —save react-native-code-push nam i rnpm rpm link react-native-code-push ᘏಋۖᵞ౮ 3.ᵞ౮ CODEPUSH_KEY CodePushDeploymentKey componentDidMount syncොဩ jsCodeLocation = [CodePush bundleURL]; ᶉἕๅෛ҅୩ګๅෛ̶ ڹݸݣڔഘጱײๅෛ 4.ݎๅෛ code-push release-react Project ios code-push release-react Project ios --t 1.2.1 --dev false --d Production --des "1.౯ฎဳ᯽ --m true ᘏಋۖ: react-native bundle --platform ଘݣ --entry-file ސۖկ --bundle-output ۱jsᬌڊկ --assets-dest ᩒრᬌڊፓ୯ --dev ฎވ᧣ᦶ code-push release <ଫአݷᑍ> <Bundlesಅࣁፓ୯> <ଫጱଫአᇇ> --deploymentNameғ ๅෛሾह --descriptionғ ๅෛൈᬿ -- mandatoryғ ฎވ୩ګๅෛ
᭗מܻቘ JavaScript RCTBridge Event Dispatcher Control Event Device Event Device
Event Device Event OC ཛྷࣘ ᧣አJS ᬬࢧJSON ےғOC੶ےJSრහഝҁݢզᑍԅғֵአ ReactJSຝጱҘ҂҅ଚڥአ JavascriptCore.framework൫ୌ᩸OCBridge҅ ֢ԅJS੶᭗ᦔጱૡ̶ٍ ഭᇇғOC੶᭗ᬦcss-layoutᏟਧᜓᅩጱ֖ᗝ̶ ᕲګғNative UIᜓᅩᬰᤈdrawRect̶
ള 1.RCTBridgeModule RCT_EXPORT_MODULE RCT_EXPORT_METHOD methodQueue 2.NativeAppEventEmitter
پӻੜወᳯ 1.فiOS۱य़ੜ ପկय़ᕅ120m҅فय़ੜپԒ෫ݒ۸ 2.ग़ӻᶭᶎ᮷አreact-native ኧӞӻ᪡ᔄ҅᭗ᬦփفӧݶጱpropertiesᵍᐶ ᘏفग़ӻࣈ࣎ 3.ਞܓiOSӧݶੴெԍې դᎱ᯾ݢզڣෙplatform Ԟݢզአӧݶጱݸᖗݷ.index.ios.js,index.android.js
ᨀᨀ
More Decks by passol1988
See All by passol1988
callkit研究
passol1988
0
64
jspatch分享
passol1988
0
32
Other Decks in Programming
See All in Programming
Enforcing Your Architecture with Unit Tests in the AI Era (Swift Connection X)
steliosf
PRO
1
200
Going Full Circle with Virtual Graphs and Relational Databases
michaelsimons
1
120
Secure Your Coding Agent Like It’s Malware (v1.5) 🇬🇧 @Code.talks 2026
richargh
0
210
Growing PicoRuby's Ecosystem on ESP32
yuuu
2
150
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
210
はじめてのPLATEAU
nokonoko1203
1
680
R言語プログラミング
profjoesuzuki
0
130
SODA - FACT BOOK(JP)
sodainc
1
40k
ローカルLLMの基本と近況 2611 / Local LLM basics and recent situation 2611
kishida
3
680
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
510
眠らない開発チームの作り方
biwakonbu
0
180
AIエージェントの「テストは通るのに本番で壊れる」を減らす
shibuiwilliam
3
130
Featured
See All Featured
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
70
69k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
340
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.3k
From π to Pie charts
rasagy
1
460
Test your architecture with Archunit
thirion
2
2.5k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.7k
What's in a price? How to price your products and services
michaelherold
247
13k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.3k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
2
540
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
1
250