Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Matrixbirds committed Jan 4, 2019
1 parent 7dc5af4 commit c53283e
Show file tree
Hide file tree
Showing 16 changed files with 161 additions and 49 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,6 @@ fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
android/src/main/res/drawable/
**/*.*~
**/*.swp
**/*.~
53 changes: 4 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,56 +26,11 @@ Either way, then link with:

`react-native link react-native-agora`

#### iOS

TARGETS->Build Phases-> Link Binary With Libaries中点击“+”按钮,选择

libresolv.tbd
libc++.tbd
AVFoundation.framework
AudioToolbox.framework
VideoToolbox.framework
CoreMotion.framework
CoreMedia.framework
CoreTelephony.framework

TARGETS->Build Phases-> Link Binary With Libaries中点击“+”按钮,在弹出的窗口中点击“Add Other”按钮,选择

node_modules/react-native-agora/ios/RCTAgora/libs/libcrypto.a
node_modules/react-native-agora/ios/RCTAgora/libs/AgoraRtcCryptoLoader.framework
node_modules/react-native-agora/ios/RCTAgora/libs/AgoraRtcEngineKit.framework

TARGETS->Build Settings->Search Paths->Framework Search Paths添加

"$(SRCROOT)/../node_modules/react-native-agora/ios/RCTAgora/libs"

TARGETS->Build Settings->Search Paths->Library Search Paths添加

"$(SRCROOT)/../node_modules/react-native-agora/ios/RCTAgora/libs"

TARGETS->Build Settings->Enable Bitcode设置为No

TARGETS->Capabilities->Background Modes->Modes勾选Audio,AirPlay,and Picture In Picture

项目目录->Info.plist->增加2项

"Privacy - Camera Usage Description":"use camera to start video call"
"Privacy - Microphone Usage Description":"use microphone to start video call"


#### Android

Add following to `AndroidManifest.xml`

<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

当您在写混淆代码时,请添加以下代码:

-keep class io.agora.**{*;}
### [iOS Installation](docs/IOS_INSTALLATION.md)
### [iOS 开发环境安装指南](docs/IOS_INSTALLATION.zh.md)

### [Android Installation](docs/ANDROID_INSTALLATION.md)
### [Android 开发环境安装指南](docs/ANDROID_INSTALLATION.zh.md)

## Documentation

Expand Down
Empty file added docs/.keeps
Empty file.
18 changes: 18 additions & 0 deletions docs/ANDROID_INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Android Installation

# Prerequisites
* Android SDK
* Android Studio

# Step 1. Add `AndroidManifest.xml`
```xml
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
```

# Obfuscation Code Edit `android/proguard-rules.pro`
```java
-keep class io.agora.**{*;}
```
18 changes: 18 additions & 0 deletions docs/ANDROID_INSTALLATION.zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Android 开发搭建指南

# 环境准备
* Android SDK
* Android Studio

# Step 1. 新增 `AndroidManifest.xml`
```xml
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
```

# 当您在写混淆代码时,请在``添加以下代码:
```script
-keep class io.agora.**{*;}
```
61 changes: 61 additions & 0 deletions docs/IOS_INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# iOS Installation

# Prerequisites
* You should installed and linked `react-native-agora`
* Xcode 10.0+

# Step 1. Open Project in Xcode
Open `ios/projectName.xcodeproj` with XCode
![Step 1](./IOS_INSTALLATION/1.1_Open_iOS_ProjectFile.png)
# Step 2. Add Link Binary With Libraries
Build Phases -> Link Binary With Libraries -> +
![Step 2](./IOS_INSTALLATION/1.2_LinkBinaryWithLibraries.png)

libresolv.tbd
libc++.tbd
AVFoundation.framework
AudioToolbox.framework
VideoToolbox.framework
CoreMotion.framework
CoreMedia.framework
CoreTelephony.framework


# Step 3. Add Other Link Binary With Libraries From `node_modules`
Build Phases -> Link Binary With Libraries -> + -> Add Other
![Step 3](./IOS_INSTALLATION/1.3_Add_Other_Libraries.png)

node_modules/react-native-agora/ios/RCTAgora/libs/libcrypto.a
node_modules/react-native-agora/ios/RCTAgora/libs/AgoraRtcCryptoLoader.framework
node_modules/react-native-agora/ios/RCTAgora/libs/AgoraRtcEngineKit.framework


# Step 4. Add Framework Search Paths
Build Settings -> Framework Search Paths -> +
![Step 4](./IOS_INSTALLATION/1.4_Add_Framework_Search_Paths.png)
"$(SRCROOT)/../node_modules/react-native-agora/ios/RCTAgora/libs"


# Step 5. Add Library Search Paths
Build Settings -> Library Search Paths -> +
![Step 5](./IOS_INSTALLATION/1.5_Add_Library_Search_Paths.png)

"$(SRCROOT)/../node_modules/react-native-agora/ios/RCTAgora/libs"


# Step 6. Set Build Settings Enable Bitcode No
Build Settings -> Enable Bitcode -> ...
![Step 6](./IOS_INSTALLATION/1.6_Set_Build_Settings_Enable_Bitcode_No.png)

# Step 7. Set Capabilities Background Modes
Capabilities -> Background Modes -> Audio, Airplay, and Picture in Picture
![Step 7](./IOS_INSTALLATION/1.7_Set_Capabilities_Background_Modes.png)

# Step 8.1 Set info.plist
Change info.plist
"Privacy - Camera Usage Description":"use camera to start video call"
"Privacy - Microphone Usage Description":"use microphone to start video call"

![Step 8.1](./IOS_INSTALLATION/1.8.1_Set_info_plist.png)

![Step 8.2](./IOS_INSTALLATION/1.8.2_Set_camera_and_microphone.png)
57 changes: 57 additions & 0 deletions docs/IOS_INSTALLATION.zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# iOS 开发搭建指南

# 环境
* 请先在项目里安装 `react-native-agora` & `react-native link react-native-agora`
* Xcode 10.0+

# Step 1. 使用Xcode打开ios项目
用Xcode打开RN项目里的`ios/RN项目.xcodeproj`文件
![Step 1](./IOS_INSTALLATION/1.1_Open_iOS_ProjectFile.png)
# Step 2. 添加如下的链接库到Xcode工程
选择 Build Phases -> Link Binary With Libraries -> +
![Step 2](./IOS_INSTALLATION/1.2_LinkBinaryWithLibraries.png)

libresolv.tbd
libc++.tbd
AVFoundation.framework
AudioToolbox.framework
VideoToolbox.framework
CoreMotion.framework
CoreMedia.framework
CoreTelephony.framework
# Step 3. 添加node_modules库到Xcode工程
选择 Build Phases-> Link Binary With Libaries中点击“+”按钮,在弹出的窗口中点击“Add Other”按钮,选择
![Step 3](./IOS_INSTALLATION/1.3_Add_Other_Libraries.png)

node_modules/react-native-agora/ios/RCTAgora/libs/libcrypto.a
node_modules/react-native-agora/ios/RCTAgora/libs/AgoraRtcCryptoLoader.framework
node_modules/react-native-agora/ios/RCTAgora/libs/AgoraRtcEngineKit.framework

# Step 4. 添加Framework Search Paths
选择 Build Settings->Search Paths->Framework Search Paths添加
"$(SRCROOT)/../node_modules/react-native-agora/ios/RCTAgora/libs"
![Step 4](./IOS_INSTALLATION/1.4_Add_Framework_Search_Paths.png)

# Step 5. 添加Library Search Paths
选择 Build Settings->Search Paths->Library Search Paths添加
"$(SRCROOT)/../node_modules/react-native-agora/ios/RCTAgora/libs"
![Step 5](./IOS_INSTALLATION/1.5_Add_Library_Search_Paths.png)


# Step 6. 设置Build Settings Enable Bitcode No
选择 Build Settings->Enable Bitcode设置为No
![Step 6](./IOS_INSTALLATION/1.6_Set_Build_Settings_Enable_Bitcode_No.png)

# Step 7. 设置Capabilities Background Modes
选择 Capabilities->Background Modes->Modes勾选Audio,AirPlay,and Picture In Picture
![Step 7](./IOS_INSTALLATION/1.7_Set_Capabilities_Background_Modes.png)

# Step 8.1 设置info.plist
修改info.plist
新增2项:
"Privacy - Camera Usage Description":"use camera to start video call"
"Privacy - Microphone Usage Description":"use microphone to start video call"

![Step 8.1](./IOS_INSTALLATION/1.8.1_Set_info_plist.png)

![Step 8.2](./IOS_INSTALLATION/1.8.2_Set_camera_and_microphone.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/IOS_INSTALLATION/1.3_Add_Other_Libraries.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/IOS_INSTALLATION/1.8.1_Set_info_plist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c53283e

Please sign in to comment.