Browse Source

docs. sample readme

matrixbirds 5 years ago
parent
commit
9cd7e80fc3
3 changed files with 18 additions and 60 deletions
  1. 4
    1
      samples/simpleDemo/README.md
  2. 13
    12
      samples/simpleDemo/README.zh.md
  3. 1
    47
      samples/simpleDemo/utils.js

+ 4
- 1
samples/simpleDemo/README.md View File

@@ -1,3 +1,5 @@
1
+# [中文版本](./README.zh.md)
2
+
1 3
 # Android Setup
2 4
 
3 5
 ## Prerequisites
@@ -8,6 +10,7 @@
8 10
   * Android Device
9 11
 
10 12
 ## Build
13
+  [More details read the doc](../../docs/ANDROID_INSTALLATION.md)
11 14
   ```bash
12 15
   adb reverse tcp:8081 tcp:8081
13 16
   adb reverse tcp:8097 tcp:8097
@@ -15,7 +18,6 @@
15 18
   npm run android
16 19
   ```
17 20
 
18
-
19 21
 # iOS Setup
20 22
 
21 23
 ## Prerequisites
@@ -25,6 +27,7 @@
25 27
   * Reliable iOS Device Cable
26 28
 
27 29
 ## Build
30
+  [More details read the doc](../../docs/IOS_INSTALLATION.md)
28 31
   ```bash
29 32
   npm install
30 33
   npm run ios

+ 13
- 12
samples/simpleDemo/README.zh.md View File

@@ -1,15 +1,16 @@
1
-# [中文版本](./README.zh.md)
1
+# [English](./README.md)
2 2
 
3
-# 构建 Android APK
3
+# Android环境搭建
4 4
 
5 5
 ## 依赖以下环境
6 6
   * linked `react-native-agora`
7 7
   * Android Studio
8 8
   * Android SDK
9
-  * Reliable USB Cable
10
-  * Android Device
9
+  * 可靠的USB数据线
10
+  * Android 设备
11 11
 
12
-## Build
12
+## 构建步骤
13
+  [详情请参阅文档](../../docs/ANDROID_INSTALLATION.zh.md)
13 14
   ```bash
14 15
   adb reverse tcp:8081 tcp:8081
15 16
   adb reverse tcp:8097 tcp:8097
@@ -17,16 +18,16 @@
17 18
   npm run android
18 19
   ```
19 20
 
21
+# iOS环境搭建
20 22
 
21
-# iOS Setup
22
-
23
-## Prerequisites
24
-  * You should installed and linked `react-native-agora`
23
+## 依赖以下环境
24
+  * linked `react-native-agora`
25 25
   * Xcode 10.0+
26
-  * iOS Device
27
-  * Reliable iOS Device Cable
26
+  * iOS 设备
27
+  * 可靠的苹果设备数据线
28 28
 
29
-## Build
29
+## 构建步骤
30
+  [详情请参阅文档](../../docs/IOS_INSTALLATION.zh.md)
30 31
   ```bash
31 32
   npm install
32 33
   npm run ios

+ 1
- 47
samples/simpleDemo/utils.js View File

@@ -1,47 +1 @@
1
-export const APPID = 'Your Agora APP_ID'; //'Your Agora APP_ID'
2
-export function handleError (code) {
3
-  let errObj = [
4
-    {
5
-      name: 'AGORA_IID_AUDIO_DEVICE_MANAGER',
6
-      code: 1,
7
-    },
8
-    {
9
-      name: 'AGORA_IID_VIDEO_DEVICE_MANAGER',
10
-      code: 2,
11
-    },
12
-    {
13
-      name: 'AGORA_IID_RTC_ENGINE_PARAMETER',
14
-      code: 3,
15
-    },
16
-    {
17
-      name: 'AGORA_IID_MEDIA_ENGINE',
18
-      code: 4,
19
-    },
20
-    {
21
-      name: 'WARN_INVALID_VIEW',
22
-      code: 8,
23
-    },
24
-    {
25
-      name: 'WARN_INIT_VIDEO',
26
-      code: 16,
27
-    },
28
-    {
29
-      name: 'WARN_PENDING',
30
-      code: 20,
31
-    },
32
-    {
33
-      name: 'ERR_JOIN_CHANNEL_REJECTED',
34
-      code: 17
35
-    },
36
-    {
37
-      name: 'ERR_START_CAMERA',
38
-      code: 1003
39
-    }
40
-  ];
41
-  
42
-  let found = errObj.find(e => e.code === code);
43
-  if (!found) {
44
-    throw new Error(`Code: ${code} isn't exists`);
45
-  }
46
-  return found;
47
-}
1
+export const APPID = 'Your Agora APP_ID'; //'Your Agora APP_ID'