Skip to content

Commit

Permalink
chore: first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
LichKing-2234 committed Dec 22, 2020
0 parents commit effe774
Show file tree
Hide file tree
Showing 60 changed files with 18,361 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .gitignore
@@ -0,0 +1,66 @@
# OSX
#
.DS_Store

# XDE
.expo/

# VSCode
.vscode/
jsconfig.json

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace

# Android/IJ
#
.idea
.gradle
local.properties
android.iml

# Cocoapods
#
example/ios/Pods
example/ios/Podfile.lock

# node.js
#
node_modules/
npm-debug.log
yarn-debug.log
yarn-error.log
package-lock.json
yarn.lock

# BUCK
buck-out/
\.buckd/
android/app/libs
android/keystores/debug.keystore
docs/api/
gitpull.sh
gitpush.sh

# Expo
.expo/*

# generated by bob
lib/
Empty file added CHANGELOG.md
Empty file.
21 changes: 21 additions & 0 deletions LICENSE
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 agora

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
72 changes: 72 additions & 0 deletions README.md
@@ -0,0 +1,72 @@
# Agora-Uniapp-SDK

此 SDK 基于 uni-app 以及 Agora Android 和 iOS 的视频 SDK 实现。

## 发版说明
[变更日志](CHANGELOG.md)

## 集成文档(离线打包)

### 克隆或下载本工程

`git clone https://github.com/AgoraIO-Community/Agora-Uniapp-SDK.git`

### 进入工程目录,执行 **install.sh** 脚本以下载 Agora iOS SDK

`cd Agora-Uniapp-SDK && sh ./install.sh`

并确保 **ios/libs** 目录中包含 **.framework** 文件

### 将 Android 和 iOS 工程分别放到 uni-app 离线 SDK 对应的目录中

* Android:**UniPlugin-Hello-AS**
* iOS:**HBuilder-uniPluginDemo**

### 将 Android 和 iOS 工程分别引入 uni-app 离线 SDK 工程

#### Android

***settings.gradle** 中添加
```
include ':uniplugin_agora_rtc'
project(':uniplugin_agora_rtc').projectDir = new File(rootProject.projectDir, 'android')
```

***app/build.gradle** 中添加 `implementation project(':uniplugin_agora_rtc')`

#### iOS

在 Xcode 中右键 **HBuilder-uniPlugin** 工程,并点击 **Add Files to "HBuilder-uniPlugin"**, 选中 **AgoraRtcUniPlugin.xcodeproj** 并添加

在 Xcode 中点击 **HBuilder-uniPlugin** 工程,并点击 **HBuilder** Target,选中 **Build Phases**

***Dependencies** 中添加 **AgoraRtcUniPlugin**
***Link Binary With Libraries** 中添加 **AgoraRtcUniPlugin.framework**
***Embed Frameworks** 中添加 **AgoraRtcKit.framework** **Agorafdkaac.framework** **Agoraffmpeg.framework** **AgoraSoundTouch.framework** (需要通过 **Add Other...** 选择 **ios/libs** 目录中的 **.framework** 文件添加)

## 如何使用

```javascript
const AgoraRtcEngineModule = uni.requireNativePlugin('AgoraRtcEngineModule');
AgoraRtcEngineModule.callMethod({ method: string, args: {} }, (res) => {});
```

具体如何调用可以参考[src](src)中的 **.ts** 文件

## 常见错误

## API文档

* [uni-app API](https://docs.agora.io/cn/Interactive%20Broadcast/API%20Reference/react_native/index.html)
* [Android API](https://docs.agora.io/cn/Interactive%20Broadcast/API%20Reference/java/index.html)
* [iOS API](https://docs.agora.io/cn/Interactive%20Broadcast/API%20Reference/oc/docs/headers/Agora-Objective-C-API-Overview.html)

## 资源

* 完整的 [API Doc](https://docs.agora.io/cn/) 在开发者中心
* [反馈问题](https://github.com/AgoraIO-Community/Agora-Uniapp-SDK/issues)
* [uni-app 原生插件](https://nativesupport.dcloud.net.cn/NativePlugin/README)

## 开源许可

MIT
64 changes: 64 additions & 0 deletions android/build.gradle
@@ -0,0 +1,64 @@
buildscript {
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
def kotlin_version = '1.3.50'

repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
// noinspection DifferentKotlinGradleVersion
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 28
buildToolsVersion "28.0.3"

defaultConfig {
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}

def kotlin_version = '1.3.50'

dependencies {
compileOnly fileTree(dir: 'libs', include: ['*.jar'])
compileOnly fileTree(dir: '../app/libs', include: ['uniapp-v8-release.aar'])

compileOnly 'com.android.support:recyclerview-v7:28.0.0'
compileOnly 'com.android.support:support-v4:28.0.0'
compileOnly 'com.android.support:appcompat-v7:28.0.0'
compileOnly 'com.alibaba:fastjson:1.1.46.android'

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation 'io.agora.rtc:full-sdk:3.2.0'
}
8 changes: 8 additions & 0 deletions android/consumer-rules.pro
@@ -0,0 +1,8 @@
-keepattributes *Annotation*
-keep class kotlin.** { *; }
-keep class org.jetbrains.** { *; }

-keep class io.agora.**{*;}

-keep public class * extends io.dcloud.feature.uniapp.common.UniModule{*;}
-keep public class * extends io.dcloud.feature.uniapp.ui.component.UniComponent{*;}
21 changes: 21 additions & 0 deletions android/proguard-rules.pro
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
19 changes: 19 additions & 0 deletions android/src/main/AndroidManifest.xml
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="io.agora.rtc.uni">

<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<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.BLUETOOTH" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission
android:name="android.permission.READ_PRIVILEGED_PHONE_STATE"
tools:ignore="ProtectedPermissions" />

</manifest>
1 change: 1 addition & 0 deletions android/src/main/java/io/agora/rtc/base/.gitignore
@@ -0,0 +1 @@
.idea/

0 comments on commit effe774

Please sign in to comment.