Browse Source

add chinese iOS documentation

matrixbirds 5 years ago
parent
commit
5aedacdba0

BIN
docs/v2/IOS_INSTALLATION/05.png View File


docs/v2/IOS_INSTALLATION/06a.png → docs/v2/IOS_INSTALLATION/05a.png View File


docs/v2/IOS_INSTALLATION/06b.png → docs/v2/IOS_INSTALLATION/05b.png View File


docs/v2/IOS_INSTALLATION/06c.png → docs/v2/IOS_INSTALLATION/05c.png View File


BIN
docs/v2/IOS_INSTALLATION/06.png View File


BIN
docs/v2/IOS_INSTALLATION/07.png View File


BIN
docs/v2/IOS_INSTALLATION/08.png View File


docs/v2/IOS_INSTALLATION/09a.png → docs/v2/IOS_INSTALLATION/08a.png View File


docs/v2/IOS_INSTALLATION/09b.png → docs/v2/IOS_INSTALLATION/08b.png View File


docs/v2/IOS_INSTALLATION/09c.png → docs/v2/IOS_INSTALLATION/08c.png View File


BIN
docs/v2/IOS_INSTALLATION/10a.png View File


BIN
docs/v2/IOS_INSTALLATION/10b.png View File


BIN
docs/v2/IOS_INSTALLATION/11.png View File


BIN
docs/v2/IOS_INSTALLATION/12.png View File


BIN
docs/v2/IOS_INSTALLATION/9a.png View File


BIN
docs/v2/IOS_INSTALLATION/9b.png View File


docs/v2/IOS_INSTALLATION/10c.png → docs/v2/IOS_INSTALLATION/9c.png View File


docs/v2/IOS_INSTALLATION/10d.png → docs/v2/IOS_INSTALLATION/9d.png View File


docs/v2/IOS_INSTALLATION/10e.png → docs/v2/IOS_INSTALLATION/9e.png View File


+ 32
- 32
docs/v2/ios.md View File

@@ -5,7 +5,7 @@
5 5
 * Android 5.0+ x86 arm64 armv7a
6 6
 
7 7
 #### 1. open up your terminal and write this :
8
-When it comes to the version nr you can put any version you like as long as it it compatibility
8
+When it comes to the version new release you can put any version you like as long as it is compatibility
9 9
 ```sh
10 10
 $ react-native init agoraguide --version react-native@0.58
11 11
 ```
@@ -30,17 +30,17 @@ $ yarn add react-native-agora
30 30
 ```
31 31
 
32 32
 
33
-#### 5. cd into your ios folder
33
+#### 4. cd into your ios folder
34 34
 ```sh
35 35
 $ cd ios
36 36
 ```
37 37
 
38
-#### 6. we need to initialize pod
39
-if you don't have cocopods installed run this command in your terminal
38
+#### 5. we need to initialize pod
39
+if you don't have CocoaPods installed run this command in your terminal
40 40
 ```sh
41
-$ gem install Cocoapods
41
+$ gem install cocoapods
42 42
 ```
43
-after you have installed Cocopods run this command inside of your ios folder
43
+after you have installed CocoaPods run this command inside of your ios folder
44 44
 ```sh
45 45
 $ pod init
46 46
 ```
@@ -48,17 +48,17 @@ and then we need to install the pods
48 48
 ```sh
49 49
 $ pod install
50 50
 ```
51
-if you get a error from Cocopods saying something like this :
52
-![Step 6](./IOS_INSTALLATION/06.png)
53
-then you need to open up your "Podfile" and remove the part that is blue marked in the picture below
51
+if you get a error from CocoaPods saying something like this :
52
+![Step 5](./IOS_INSTALLATION/05.png)
53
+then you need to open up your `Podfile` and remove the part that is blue marked in the picture below
54 54
 
55 55
 #### *before*
56
-![Step 6](./IOS_INSTALLATION/06a.png)
56
+![Step 5](./IOS_INSTALLATION/05a.png)
57 57
 
58 58
 #### *after*
59
-![Step 6](./IOS_INSTALLATION/06b.png)
59
+![Step 5](./IOS_INSTALLATION/05b.png)
60 60
 
61
-we need to add this code at the bottom to our pod file
61
+we need to add this code at the bottom to our `Podfile`
62 62
 ```sh
63 63
 post_install do |installer|
64 64
   installer.pods_project.targets.each do |target|
@@ -79,51 +79,51 @@ post_install do |installer|
79 79
 end
80 80
 ```
81 81
 This is how your podfile should look like
82
-![Step 6](./IOS_INSTALLATION/06c.png)
82
+![Step 5](./IOS_INSTALLATION/05c.png)
83 83
 after that you can run this command again
84 84
 ```sh
85 85
 $ pod install
86 86
 ```
87 87
 
88
-#### 7. Open up your xcode project *[project name].xcworkspace* inside in ios folder
89
-![Step 7](./IOS_INSTALLATION/07.png)
88
+#### 6. Open up your Xcode project *[project name].xcworkspace* inside in ios folder
89
+![Step 6](./IOS_INSTALLATION/06.png)
90 90
 
91
-#### 8. expand your project folder and right click on the *"Libraries"* folder and choose *"add files to [project name]"*
92
-![Step 8](./IOS_INSTALLATION/08.png)
91
+#### 7. expand your project folder and right click on the *"Libraries"* folder and choose *"add files to [project name]"*
92
+![Step 7](./IOS_INSTALLATION/07.png)
93 93
 
94
-#### 9. follow the image below to find the RCTAgora lib
94
+#### 8. follow the image below to find the RCTAgora lib
95 95
 
96
-![Step 9](./IOS_INSTALLATION/09a.png)
96
+![Step 8](./IOS_INSTALLATION/08a.png)
97 97
 the path is  node_modules => react-native-agora => ios => RCTAgora.xcodeproj
98 98
 
99 99
 make sure you check so that those are checked
100 100
 
101
-![Step 9](./IOS_INSTALLATION/09b.png)
101
+![Step 8](./IOS_INSTALLATION/08b.png)
102 102
 
103 103
 If the file is greyed out it means you already have it inside of you library folder.
104 104
 Check so that RCTAgora.xcodeproj are inside of your "Libraries" folder
105
-![Step 9](./IOS_INSTALLATION/09c.png)
105
+![Step 8](./IOS_INSTALLATION/08c.png)
106 106
 
107
-#### 10. we need to add the framework
107
+#### 9. we need to add the framework
108 108
 expand your "Frameworks" folder and you should see the "AgoraRtcEngineKit.framework" are red.
109
-![Step 10](./IOS_INSTALLATION/10a.png)
109
+![Step 9](./IOS_INSTALLATION/9a.png)
110 110
 right click and delete that
111
-Left click on your "RCTAgora.xcodeproj" and clöick on "Build Phases"
112
-![Step 10](./IOS_INSTALLATION/10b.png)
111
+Left click on your "RCTAgora.xcodeproj" and click on "Build Phases"
112
+![Step 9](./IOS_INSTALLATION/9b.png)
113 113
 left click on the "AgoraRtcEngineKit.framework" in the list and click on the "-"(minus sign) to remove it from the list.
114
-![Step 10](./IOS_INSTALLATION/10c.png)
114
+![Step 9](./IOS_INSTALLATION/9c.png)
115 115
 then click on the "+"(plus sign) so that we can add the framework.
116 116
 Click on the "Add other..." button
117
-![Step 10](./IOS_INSTALLATION/10d.png)
117
+![Step 9](./IOS_INSTALLATION/9d.png)
118 118
 then we need to navigate and find our framwork
119
-![Step 10](./IOS_INSTALLATION/10e.png)
119
+![Step 9](./IOS_INSTALLATION/9e.png)
120 120
 the path is : ios => Pods => AgoraRtcEngine_iOS => AgoraRtcEngineKit.framework and click on "add"
121 121
 
122
-#### 11. at last we need to link the library
123
-click on your project on the left and then click on "Build Phases" and then expand "Link Binary With Libraries" and then click on the "+"(plug sign)
124
-![Step 11](./IOS_INSTALLATION/11.png)
122
+#### 10. at last we need to link the library
123
+click on your project on the left and then click on "Build Phases" and then expand "Link Binary With Libraries" and then click on the "+"(plus sign)
124
+![Step 10](./IOS_INSTALLATION/10a.png)
125 125
 Search for libRCTAGora and click on add
126
-![Step 11](./IOS_INSTALLATION/12.png)
126
+![Step 10](./IOS_INSTALLATION/10b.png)
127 127
 if you cant find it in your list check so that you dont already have it
128 128
 
129 129
 ----------------------------------------------

+ 133
- 23
docs/v2/ios.zh.md View File

@@ -1,34 +1,144 @@
1 1
 # iOS 开发搭建指南
2
+#### 最低兼容
3
+* React Native 0.58.x
4
+* iOS SDK 8.0+
5
+* Android 5.0+ x86 arm64 armv7a
2 6
 
3
-# 环境
4
-* 请先在项目里安装 `react-native-agora` & `react-native link react-native-agora`
5
-* Xcode 10.0+
6
-* 安装cocoapods
7
+#### 1. 打开你的终端,输入如下命令:
8
+对于新版本,你可以放置任何你喜欢的版本,只要它兼容。
9
+```
10
+$ react-native init agoraguide --version react-native@0.58
11
+```
12
+
13
+#### 2. cd 到你的项目目录
14
+```sh
15
+$ cd agoraguide
16
+```
17
+
18
+#### 3. 安装 react-native-agora
19
+
20
+npm方式
21
+```sh
22
+$ npm install --save react-native-agora
23
+```
24
+
25
+yarn方式
26
+```sh
27
+$ yarn add react-native-agora
28
+```
29
+
30
+#### 4. cd 到你的ios目录
31
+```sh
32
+$ cd ios
33
+```
7 34
 
8
-```bash
9
-# 需要首先安装好ruby
10
-gem install cocoapods
35
+#### 5. 安装pod
36
+如果你没有安装过CocoaPods,在你的终端里输入以下命令并执行:
37
+```sh
38
+$ gem install Cocoapods
39
+```
40
+在成功安装CocoaPods后,在你项目的ios目录里执行以下命令:
41
+```sh
42
+$ pod init
11 43
 ```
44
+接着执行安装pods
45
+```sh
46
+$ pod install
47
+```
48
+当你在安装pod过程中,遇到问题如下的报错时:
49
+![Step 5](./IOS_INSTALLATION/05.png)
50
+你需要打开`Podfile`并且如下图所示的蓝色部分。
51
+
52
+#### *选中这部分*
53
+![Step 5](./IOS_INSTALLATION/05a.png)
54
+
55
+#### *删除后*
56
+![Step 5](./IOS_INSTALLATION/05b.png)
57
+
58
+在`Podfile`底部加入以下代码:
59
+```sh
60
+post_install do |installer|
61
+  installer.pods_project.targets.each do |target|
12 62
 
13
-# Step 1. 首先安装
14
-```bash
15
-pod install
63
+    # The following is needed to ensure the "archive" step works in XCode.
64
+    # It removes React & Yoga from the Pods project, as it is already included in the main project.
65
+    # Without this, you'd see errors when you archive like:
66
+    # "Multiple commands produce ... libReact.a"
67
+    # "Multiple commands produce ... libyoga.a"
68
+
69
+    targets_to_ignore = %w(React yoga)
70
+    
71
+    if targets_to_ignore.include? target.name
72
+      target.remove_from_project
73
+    end
74
+
75
+  end
76
+end
77
+```
78
+这是最终修改好的`Podfile`,如图所示。
79
+![Step 5](./IOS_INSTALLATION/05c.png)
80
+之后你就可以执行安装命令:
81
+```
82
+$ pod install
16 83
 ```
17 84
 
18
-# Step 2. 使用xcode开启项目  
19
-打开 `ios/projectName.xcworkspace`
20
-![Step 2](./IOS_INSTALLATION/1.2_OpenProject.png)
85
+#### 6. 在你项目的ios目录里,打开Xcode工程文件 *[项目名].xcworkspace 
86
+![Step 6](./IOS_INSTALLATION/06.png)
87
+
88
+#### 7. 展开你的项目目录,并且右键点击*"Libraries"* 目录并且选择*"add file to [project name]"*
89
+![Step 7](./IOS_INSTALLATION/07.png)
90
+
91
+#### 8. 按照下图去找到RCTAgora lib
92
+![Step 8](./IOS_INSTALLATION/08a.png)
93
+你可以沿路径找到:node_modules => react-native-agora => ios => RCTAgora.xcodeproj
94
+
95
+请按照如图所示的方式确认你已经配好编译环境
96
+![Step 8](./IOS_INSTALLATION/08b.png)
97
+
98
+如果下图所示的文件是灰色的,请确保它的路径是在你的目录里的。
99
+请检查`RCTAgora.xcodeproj`是否在`Libraries`目录中。
100
+![Step 8](./IOS_INSTALLATION/08c.png)
101
+
102
+#### 9. 检查你的Framework是否已经成功设置
103
+展开你的 "Frameworks" 目录,如果看到红色的 "AgoraRtcEngineKit.framework",你需要按照以下步骤重新把它载入到编译环境。
104
+![Step 9](./IOS_INSTALLATION/9a.png)
105
+单击右键并删除。
106
+单击左键 "RCTAgora.xcodeproj" 找到并点击 "Build Phases"
107
+![Step 9](./IOS_INSTALLATION/9b.png)
108
+在列表里找到 "AgoraRtcEngineKit.framework" 单击左键 找到 "-"(减号按钮) 把它从列表里删除。
109
+![Step 9](./IOS_INSTALLATION/9c.png)
110
+然后点击"+"(加号按钮) 点击"Add other..."按钮。
111
+![Step 9](./IOS_INSTALLATION/9d.png)
112
+按照图下方式,找到"AgoraRtcEngineKit.framework"
113
+![Step 9](./IOS_INSTALLATION/9e.png)
114
+你可以沿路径找到: ios => Pods => AgoraRtcEngine_iOS => AgoraRtcEngineKit.framework 并且点击 "add"
115
+
116
+#### 10. 最后我们需要连接Library
117
+点击你的项目左侧,并且点击"Build Phases"然后展开"Link Binary With Libraries"接着点击"+"(加号按钮)
118
+click on your project on the left and then click on "Build Phases" and then expand "Link Binary With Libraries" and then click on the "+"(plug sign)
119
+![Step 10](./IOS_INSTALLATION/10a.png)
120
+找到 libRCTAgora 并且点击"add"
121
+![Step 10](./IOS_INSTALLATION/10b.png)
122
+如果你无法在列表里找到它,表明你还没安装它。
123
+
124
+----------------------------------------------
125
+### 常见故障排除
126
+
127
+如果你遇到类似的报错:
128
+![Step t1](./IOS_INSTALLATION/t01.png)
129
+![Step t2](./IOS_INSTALLATION/t02.png)
130
+
131
+可能是因为你有一些框架已经导入了相同的头文件,例如firestore库也会引入time.h, 
132
+
133
+展开你项目里的"Libraries" 并且点击"RCTAgora.xcodeproj"。然后点击"Build settings" 并且找到"Header search paths",按照以下方法设置。 
134
+![Step t3](./IOS_INSTALLATION/t03.png)
135
+双击当前选中的路径
136
+![Step t4](./IOS_INSTALLATION/t04.png)
137
+把路径里的"recursive"修改成"non-recursive"
138
+![Step t5](./IOS_INSTALLATION/t05.png)
139
+
140
+
21 141
 
22
-# Step 3. 在项目里新增RCTAgora项目到Libraries目录里
23
-![Step 3.1](./IOS_INSTALLATION/1.3_Add_Files_To_Project.png)
24
-![Step 3.2](./IOS_INSTALLATION/1.3.1_RCTAgora.png)
25
-根据以下的步骤。重新加载RCTAgora里面的AgoraRtcEngineKit。
26
-![Step 3.3](./IOS_INSTALLATION/1.3.3_UPDATE_RCTAgora_AgoraRtcEngineKit_Framework.png)
27
-![Step 3.4](./IOS_INSTALLATION/1.3.4_SELECT_AgoraRtcEngineKit_from_iOS_Pods_folder.png)
28
-![Step 3.5](./IOS_INSTALLATION/1.3.5_DRAG_IT_INTO_Link_Binary_With_Libraries.png)
29 142
 
30
-# Step 4. 把RCTAgora.a 添加到linked libraries里
31
-![Step 4.3](./IOS_INSTALLATION/1.4.1_SET_RCTAgora.a.png)
32 143
 
33
-# Step 5. xcode 编译并运行
34 144