{"id":522,"date":"2023-02-25T15:39:38","date_gmt":"2023-02-25T07:39:38","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=522"},"modified":"2023-04-29T20:43:47","modified_gmt":"2023-04-29T12:43:47","slug":"react-native-operational-official-project-f8app-compatible-with-iosmac","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/25\/react-native-operational-official-project-f8app-compatible-with-iosmac\/","title":{"rendered":"React Native\u5b9e\u6218\u4e4b\u8fd0\u884c\u5b98\u65b9\u9879\u76eef8app(\u9002\u914dIOS_Mac)"},"content":{"rendered":"<h2>F8 App \u7b80\u4ecb<\/h2>\n<p>Facebook \u5728 2016 \u5e74\u7684 F8 \u5927\u4f1a\u4e0a\u5f00\u6e90\u4e86 F8 App\uff0c\u8fd9\u662f\u4f7f\u7528React Native\u5f00\u53d1\u7684\uff0c\u6beb\u65e0\u7591\u95ee\u8fd9\u662f\u4e00\u4e2a\u7279\u522b\u68d2\u7684React Native\u7684\u5b66\u4e60\u6a21\u677f\u3002<\/p>\n<p>\u9879\u76ee\u5730\u5740\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/fbsamples\/f8app\">https:\/\/github.com\/fbsamples\/f8app<\/a><\/p>\n<p><!-- more --><\/p>\n<p>\u8fd0\u884c F8 App \u9700\u8981React Native\u3001Redux\u3001Relay\u3001GraphQL\u7b49\u3002<\/p>\n<p>Facebook \u5728 F8 \u5f00\u53d1\u8005\u5927\u4f1a\u4e0a\u5ba3\u5e03\u4ed6\u4eec\u7528 React Native \u5f00\u53d1\u4e86 F8 \u5f00\u53d1\u8005\u5927\u4f1a\u7684\u5b98\u65b9\u5e94\u7528\u3002\u4ed6\u4eec\u4e0d\u4ec5\u4ec5\u5f00\u53d1\u4e86\u5e94\u7528\uff08\u53ef\u4ece App Store \u548c Google Play \u4e0b\u8f7d\uff09\uff0c\u8fd8\u8bbe\u7f6e\u4e86\u4e00\u4e2a\u5b98\u65b9\u7f51\u7ad9\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"http:\/\/makeitopen.com\/\">http:\/\/makeitopen.com\/<\/a> \uff0c\u5f00\u6e90\u4e86\u5b98\u65b9\u5e94\u7528\u7684\u4ee3\u7801\uff0c\u5e76\u4e14\u8fd8\u5199\u4e86\u5982\u4f55\u5f00\u53d1\u7684\u6559\u7a0b\u3002\u8fd9\u5c06\u662f\u5f00\u53d1\u8005\u5b66\u4e60 React Native \u975e\u5e38\u597d\u7684\u6559\u7a0b\u3002<\/p>\n<p>\u6559\u7a0b\u5730\u5740\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/pockry\/Building-the-F8-2016-App-CN#rd\">https:\/\/github.com\/pockry\/Building-the-F8-2016-App-CN#rd<\/a><\/p>\n<p>\u5bf9\u9879\u76ee\u7684\u6574\u4f53\u4e86\u89e3\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"http:\/\/f8-app.liaohuqiu.net\/\">http:\/\/f8-app.liaohuqiu.net\/<\/a><\/p>\n<h2>\u642d\u5efa\u73af\u5883\u8981\u6c42<\/h2>\n<ul>\n<li>Node<\/li>\n<li>React Native\uff1aiOS\u548cAndroid\u7684\u914d\u7f6e\u73af\u5883<\/li>\n<li>MongoDB <\/li>\n<li>Mac\u4e0a\u8fd0\u884ciOS\u7684Demo\u9700\u8981\uff1aXcode 7.3+\u3001CocoaPods(iOS\u9879\u76ee\u7684\u5305\u7ba1\u7406\u5de5\u5177)<\/li>\n<li>Windows\u4e0a\u8fd0\u884cAndroid\u7684Demo\u9700\u8981\uff1aGradle\u3001Android SDK<\/li>\n<\/ul>\n<p>\u9879\u76ee\u5730\u5740\uff1agit clone <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/fbsamples\/f8app.git\">https:\/\/github.com\/fbsamples\/f8app.git<\/a><\/p>\n<h2>MAC \u73af\u5883\u8fd0\u884c F8App<\/h2>\n<h3>\u5b89\u88c5\u4f9d\u8d56\uff08\u8fdb\u5165f8app\u76ee\u5f55\u4e0bnpm install\uff09<\/h3>\n<p>npm \u7248\u672c\u5fc5\u987b\u8981\u6c42 v3+<\/p>\n<p>Mac\u4e0b\u53ef\u4ee5\u5b89\u88c5n\u6a21\u5757<\/p>\n<pre><code>npm install -g n<\/code><\/pre>\n<p>n\u6a21\u5757\u662f\u4e13\u95e8\u7528\u6765\u7ba1\u7406node.js\u7684\u7248\u672c\u7684\uff0c\u4f7f\u7528\u547d\u4ee4<code>n stable<\/code>\u5373\u53ef\u66f4\u65b0 Node<\/p>\n<h3>\u5b89\u88c5\u4f9d\u8d56\uff08\u8fdb\u5165f8app\/ios\u76ee\u5f55\u4e0bpod install &#8211;no-repo-update\uff09<\/h3>\n<p>\u88ab\u5899\uff0c\u6267\u884cpod install\u65e0\u6cd5\u6210\u529f\uff01<\/p>\n<pre><code>pod CocoaPods<\/code><\/pre>\n<p>CocoaPods\u662f\u4e00\u4e2a\u7528\u6765\u5e2e\u52a9\u6211\u4eec\u7ba1\u7406\u7b2c\u4e09\u65b9\u4f9d\u8d56\u5e93\u7684\u5de5\u5177\u3002\u5b83\u53ef\u4ee5\u89e3\u51b3\u5e93\u4e0e\u5e93\u4e4b\u95f4\u7684\u4f9d\u8d56\u5173\u7cfb\uff0c\u4e0b\u8f7d\u5e93\u7684\u6e90\u4ee3\u7801\uff0c\u540c\u65f6\u901a\u8fc7\u521b\u5efa\u4e00\u4e2aXcode\u7684workspace\u6765\u5c06\u8fd9\u4e9b\u7b2c\u4e09\u65b9\u5e93\u548c\u6211\u4eec\u7684\u5de5\u7a0b\u8fde\u63a5\u8d77\u6765\uff0c\u4f9b\u6211\u4eec\u5f00\u53d1\u4f7f\u7528\u3002<\/p>\n<p>\u4f7f\u7528CocoaPods\u7684\u76ee\u7684\u662f\u8ba9\u6211\u4eec\u80fd\u81ea\u52a8\u5316\u7684\u3001\u96c6\u4e2d\u7684\u3001\u76f4\u89c2\u7684\u7ba1\u7406\u7b2c\u4e09\u65b9\u5f00\u6e90\u5e93\u3002<\/p>\n<p>\u5347\u7ea7ruby\u73af\u5883 \u66f4\u65b0ruby\u7684\u6dd8\u5b9d\u955c\u50cf \u5b89\u88c5Cocoapods<\/p>\n<pre><code>sudo gem install cocoapods<\/code><\/pre>\n<p>\u901a\u8fc7rvm(ruby version manager)<\/p>\n<p>\u6267\u884c<code>pod install<\/code>\u547d\u4ee4<br \/>\n\u51fa\u73b0<code>Setting up CocoaPods master repo<\/code>\uff0c\u8bf4\u660eCocoapods\u5728\u5c06\u5b83\u7684\u4fe1\u606f\u4e0b\u8f7d\u5230<code>~\/.cocoapods<\/code>\u91cc\u3002cd \u5230\u8be5\u76ee\u5f55\u91cc\uff0c\u7528<code>du -sh *<\/code>\u547d\u4ee4\u6765\u67e5\u770b\u6587\u4ef6\u5927\u5c0f\uff0c\u6bcf\u9694\u51e0\u5206\u949f\u67e5\u770b\u4e00\u6b21\uff0c\u5927\u5c0f\u4f1a\u53d8\u5316<\/p>\n<p>\u5176\u5b9e\u771f\u6b63\u6162\u7684\u539f\u56e0\u5e76\u4e0d\u5728pod\u547d\u4ee4\uff0c\u800c\u662f\u5728\u4e8egithub\u4e0a\u7684\u4ee3\u7801\u5e93\u8bbf\u95ee\u901f\u5ea6\u6162\uff0c\u90a3\u4e48\u5c31\u77e5\u9053\u771f\u6b63\u7684\u89e3\u51b3\u65b9\u6848\u5c31\u662f\u8981\u52a0\u5febgit\u547d\u4ee4\u7684\u901f\u5ea6\u3002<br \/>\n\u6211\u4f7f\u7528Shadowsocks\u4ee3\u7406\uff0c\u9ed8\u8ba4\u4ee3\u7406\u7aef\u53e3\u4e3a1080\uff0c\u914d\u7f6e\u597d\u4ee3\u7406\u4e4b\u540e\u53bb\u7ec8\u7aef\u8f93\u5165git\u914d\u7f6e\u547d\u4ee4\uff0c\u547d\u4ee4\u5982\u4e0b<\/p>\n<p>\u914d\u7f6e\u4ee3\u7406\uff1agit config &#8211;global http.<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com.proxy\">https:\/\/github.com.proxy<\/a> socks5:\/\/127.0.0.1:1080<br \/>\n\u53d6\u6d88\u4ee3\u7406\uff1agit config &#8211;global &#8211;unset http.<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com.proxy\">https:\/\/github.com.proxy<\/a><\/p>\n<p>\u6267\u884c\u5b8c\u540e \u4f1a\u62a5\u9519\uff1a<\/p>\n<pre><code>ng dependencies\nFetching podspec for `CodePush` from `..\/node_modules\/react-native-code-push`\nFetching podspec for `React` from `..\/node_modules\/react-native`\nFetching podspec for `react-native-fbsdk` from `..\/node_modules\/react-native-fbsdk\/iOS`\n[!] No podspec found for `react-native-fbsdk` in `..\/node_modules\/react-native-fbsdk\/iOS`<\/code><\/pre>\n<p>\u89e3\u51b3\u65b9\u6cd5\uff1a\u5230\u76ee\u5f55<code>f8app\/node_modules<\/code>\u4e0b\u5220\u9664<code>react-native-fbsdk<\/code>\uff0c\u7136\u540e\u5728\u76ee\u5f55<code>f8app\/<\/code>\u4e0b<code>npm install react-native-fbsdk --save<\/code>\uff0c\u53ef\u80fd\u6709\u4e00\u5927\u63a8\u8b66\u544a<br \/>\n\u7136\u540e\u5728\u76ee\u5f55<code>f8app\/ios\/<\/code>\u4e0b<code>pod install<\/code>\u4f1a\u5b89\u88c5\u90a3\u4e9b\u4f9d\u8d56<\/p>\n<pre><code>\u63d0\u793a\uff1a[!] Please close any current Xcode sessions and use `F8v2.xcworkspace` for this project from now on.\nSending stats\nPod installation complete! There are 13 dependencies from the Podfile and 7\ntotal pods installed.<\/code><\/pre>\n<h3>\u5b89\u88c5MongoDB\u5e76\u786e\u8ba4\u5176\u8fd0\u884c\u6b63\u5e38<\/h3>\n<pre><code>To install the MongoDB binaries that have TLS\/SSL support, issue the following from a system shell:\nbrew install mongodb --with-openssl<\/code><\/pre>\n<p>\u67e5\u770b\uff1a<code>brew info mongo<\/code><br \/>\n\u542f\u52a8MongoDB\uff1a<code>brew services start mongodb<\/code><br \/>\n\u786e\u8ba4\uff1a<code>lsof -iTCP:27017 -sTCPISTEN<\/code> \u7aef\u53e3\u76d1\u542c<\/p>\n<h3>Start Parse \/ GraphQL servers<\/h3>\n<p>\u90fd\u662ff8app\u76ee\u5f55\u4e0b\u8fd0\u884c\uff1a<code>npm start<\/code>\u4e0e<code>react-native start<\/code>\uff08\u5b98\u65b9\u5c11\u4e86\u8fd9\u6b65\u9aa4\uff09<\/p>\n<h3>\u5bfc\u5165\u793a\u4f8b\u6570\u636e\uff08\u5728f8app\u76ee\u5f55\u4e0b\uff09<\/h3>\n<pre><code>$ npm run import-data\n$ mongo\nMongoDB shell version: 3.2.8\nconnecting to: test\n>\n> show databases\nadmin  (empty)\ndev    0.078GB\nlocal  0.078GB\n> use dev\nswitched to db dev\n> show collections\nAgenda\nFAQ\nMaps\nNotification\nPage\nSpeakers\nSurvey\n_Installation\n_SCHEMA\nsystem.indexes\n> db.FAQ.find()<\/code><\/pre>\n<h3>\u518d\u6b21\u786e\u4fdd\u6b63\u5e38\u5e76\u4e14\u6709\u6570\u636e<\/h3>\n<pre><code>Parse Dashboard: http:\/\/localhost:8080\/dashboard\nGraph*i*QL: http:\/\/localhost:8080\/graphql?query=query+%7B%0A++schedule+%7B%0A++++title%0A++++speakers+%7B%0A++++++name%0A++++++title%0A++++%7D%0A++++location+%7B%0A++++++name%0A++++%7D%0A++%7D%0A%7D<\/code><\/pre>\n<h3>\u8fd0\u884c\u5728ios\u8bbe\u5907\u4e0a<\/h3>\n<p>\u5728f8app\u76ee\u5f55\u4e0b\uff1a<code>react-native run-ios<\/code><\/p>\n<p>\u6216\u4f7f\u7528Xcode 7.3\u4ee5\u4e0a\u6253\u5f00<code>f8app\/ios\/<\/code>\u76ee\u5f55\u4e0b\u7684<code>F8v2.xcworkspace<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>F8 App \u7b80\u4ecb Facebook \u5728 2016 \u5e74\u7684 F8 \u5927\u4f1a\u4e0a\u5f00\u6e90\u4e86 F8 App\uff0c\u8fd9\u662f\u4f7f\u7528React [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[163],"tags":[],"class_list":["post-522","post","type-post","status-publish","format-standard","hentry","category-react-native"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/522","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=522"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/522\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=522"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=522"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}