Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update docs #41

Merged
merged 2 commits into from
Mar 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 not shown.
Binary file not shown.
Binary file not shown.
9 changes: 5 additions & 4 deletions docs/v2/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@

# 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" />
<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.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
```

# Step 2. Add `react-native-agora` to `settings.gradle`
Expand Down
9 changes: 5 additions & 4 deletions docs/v2/android.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@

# 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" />
<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.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
```

# Step 2. 在android目录里的`settings.gradle`新增`react-native-agora`的依赖管理
Expand Down
22 changes: 10 additions & 12 deletions docs/v2/ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,24 @@ gem install cocoapods

# Step 1. install pod dependencies
```bash
cd ios
pod install
```
pod install success will create `<projectName>`.xcworkspace file in ios folder.

# Step 2. Open Workspace Project in Xcode
# Step 2. Open the xcworkspace Project in Xcode
Open `ios/projectName.xcworkspace` with XCode
![Step 2](./IOS_INSTALLATION/1.2_OpenProject.png)

# Step 3. Add RCTAgora to the Project Libraries folder
![Step 3.1](./IOS_INSTALLATION/1.3_Add_Files_To_Project.png)
![Step 3.2](./IOS_INSTALLATION/1.3.1_RCTAgora.png)
select the AgoraRtcEngineKit and re-added by below steps.
![Step 3.3](./IOS_INSTALLATION/1.3.3_UPDATE_RCTAgora_AgoraRtcEngineKit_Framework.png)
![Step 3.4](./IOS_INSTALLATION/1.3.4_SELECT_AgoraRtcEngineKit_from_iOS_Pods_folder.png)
![Step 3.5](./IOS_INSTALLATION/1.3.5_DRAG_IT_INTO_Link_Binary_With_Libraries.png)

# Step 4. Add Linked Library to the xcode project
![Step 4.1](./IOS_INSTALLATION/1.4.1_SET_LINKED_LIBARIES.png)
![Step 4.2](./IOS_INSTALLATION/1.4.1_SET_LINKED_LIBARIES.png)
![Step 4.3](./IOS_INSTALLATION/1.4.2_SET_RCTAgora.a.png)

# Step 5. Set Framework and Libraries Search Paths
![Step 5.1](./IOS_INSTALLATION/1.5.1_Add_Framework_Search_Paths.png)
![Step 5.2](./IOS_INSTALLATION/1.5.2_Add_Library_Search_Paths.png)


# Step 6. build and run it with xcode
# Step 4. Only Add Linked Library to the xcode project
![Step 4.3](./IOS_INSTALLATION/1.4.1_SET_RCTAgora.a.png)

# Step 5. build and run it with xcode
17 changes: 7 additions & 10 deletions docs/v2/ios.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,13 @@ pod install
# Step 3. 在项目里新增RCTAgora项目到Libraries目录里
![Step 3.1](./IOS_INSTALLATION/1.3_Add_Files_To_Project.png)
![Step 3.2](./IOS_INSTALLATION/1.3.1_RCTAgora.png)
根据以下的步骤。重新加载RCTAgora里面的AgoraRtcEngineKit。
![Step 3.3](./IOS_INSTALLATION/1.3.3_UPDATE_RCTAgora_AgoraRtcEngineKit_Framework.png)
![Step 3.4](./IOS_INSTALLATION/1.3.4_SELECT_AgoraRtcEngineKit_from_iOS_Pods_folder.png)
![Step 3.5](./IOS_INSTALLATION/1.3.5_DRAG_IT_INTO_Link_Binary_With_Libraries.png)

# Step 4. 把react-native-agora添加到linked libraries里
![Step 4.1](./IOS_INSTALLATION/1.4.1_SET_LINKED_LIBARIES.png)
![Step 4.2](./IOS_INSTALLATION/1.4.1_SET_LINKED_LIBARIES.png)
![Step 4.3](./IOS_INSTALLATION/1.4.2_SET_RCTAgora.a.png)
# Step 4. 把RCTAgora.a 添加到linked libraries里
![Step 4.3](./IOS_INSTALLATION/1.4.1_SET_RCTAgora.a.png)

# Step 5. 设置 Framework & Libraries Search Paths
![Step 5.1](./IOS_INSTALLATION/1.5.1_Add_Framework_Search_Paths.png)
![Step 5.2](./IOS_INSTALLATION/1.5.2_Add_Library_Search_Paths.png)


# Step 6. xcode 编译并运行
# Step 5. xcode 编译并运行

23 changes: 22 additions & 1 deletion samples/simpleDemo/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

import React, {Component} from 'react';
import {
StyleSheet, Text, View, TouchableOpacity, TextInput
StyleSheet, Text, View, TouchableOpacity, TextInput,
PermissionsAndroid
} from 'react-native';
import AgoraRTCView from './components/agora';

Expand Down Expand Up @@ -69,6 +70,26 @@ export default class App extends Component<Props> {
})
}

async requestCameraAndAudioAndroidPermission() {
try {
const granted = await PermissionsAndroid.requestMultiple([
PermissionsAndroid.PERMISSIONS.CAMERA,
PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,
]);
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
console.log('You can use the camera');
} else {
console.log('Camera permission denied');
}
} catch (err) {
console.warn(err);
}
}

componentWillMount () {
this.requestCameraAndAudioAndroidPermission().then(_ => {});
}

render() {
if (this.state.showLive) {
console.log('channelName', this.state.channelName);
Expand Down
6 changes: 3 additions & 3 deletions samples/simpleDemo/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ PODS:
- AgoraRtcEngine_iOS (2.3.3)
- React (0.58.3):
- React/Core (= 0.58.3)
- react-native-agora (2.3.3-alpha.4):
- react-native-agora (2.3.3-alpha.5):
- AgoraRtcEngine_iOS (= 2.3.3)
- React
- react-native-agora/AgoraRtcCryptoLoader (= 2.3.3-alpha.4)
- react-native-agora/AgoraRtcCryptoLoader (2.3.3-alpha.4):
- react-native-agora/AgoraRtcCryptoLoader (= 2.3.3-alpha.5)
- react-native-agora/AgoraRtcCryptoLoader (2.3.3-alpha.5):
- AgoraRtcEngine_iOS (= 2.3.3)
- React
- React/Core (0.58.3):
Expand Down
Loading