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

RN分享

 RN分享

Avatar for passol1988

passol1988

March 11, 2017

More Decks by passol1988

Other Decks in Programming

Transcript

  1. ୏ݎሾह൫ୌ 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
  2. ኞ޸ޮ๗ ୏ত getDefaultProps getInitialSatte componentWillMount render componentDidMount ᬩᤈӾ ં௔propsදݒ componentWillReceiveProps

    stateදݒ shouldComponentUpdate componentWillUpdate render componentDidUpdate ܬ᫹ componentWillUnmount ᕮ๳ ฎ ވ
  3. ᅾๅෛ(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ғ ฎވ୩ګๅෛ
  4. ᭗מܻቘ 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̶