Ver código fonte

fix. android native secret key nil

matrixbirds 5 anos atrás
pai
commit
3ce8000cbb

+ 10
- 1
android/build.gradle Ver arquivo

@@ -1,5 +1,14 @@
1 1
 apply plugin: 'com.android.library'
2 2
 
3
+allprojects {
4
+    gradle.projectsEvaluated {
5
+        tasks.withType(JavaCompile) {
6
+            options.encoding = 'utf-8'
7
+            options.compilerArgs << "-Xlint:deprecation"
8
+        }
9
+    }
10
+}
11
+
3 12
 buildscript {
4 13
     repositories {
5 14
         google()
@@ -67,7 +76,7 @@ repositories {
67 76
     mavenCentral()
68 77
     mavenLocal()
69 78
     maven {
70
-        url "file:///Users/ly/GithubPremium/react-native-agora/node_modules/react-native"
79
+        url "$rootDir/../node_modules/react-native/android"
71 80
     }
72 81
     jcenter()
73 82
     google()

+ 0
- 0
android/gradlew Ver arquivo


+ 0
- 0
android/gradlew.bat Ver arquivo


+ 2
- 2
android/src/main/java/com/syan/agora/AgoraManager.java Ver arquivo

@@ -93,9 +93,9 @@ public class AgoraManager {
93 93
         //create rtcEngine instance and setup rtcEngine eventHandler
94 94
         try {
95 95
             mRtcEngine = RtcEngine.create(context, options.getString("appid"), mRtcEventHandler);
96
-            if (null != options.getString("secret")) {
96
+            if (options.hasKey("secret") && null != options.getString("secret")) {
97 97
                 mRtcEngine.setEncryptionSecret(options.getString("secret"));
98
-                if (null != options.getString("secretMode")) {
98
+                if (options.hasKey("secretMode") && null != options.getString("secretMode")) {
99 99
                     mRtcEngine.setEncryptionMode(options.getString("secretMode"));
100 100
                 }
101 101
             }