Skip to content

Commit

Permalink
feat: upgrade native SDK to 3.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
LichKing-2234 committed Apr 13, 2021
1 parent d527af6 commit a391548
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 20 deletions.
4 changes: 1 addition & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ buildscript {

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

def getExtOrDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['Agora_' + name]
Expand Down Expand Up @@ -128,7 +127,6 @@ def kotlin_version = getExtOrDefault('kotlinVersion')
dependencies {
// noinspection GradleDynamicVersion
api 'com.facebook.react:react-native:+'
api "io.agora.rtc:full-sdk:3.3.1"
api "io.agora.rtc:full-sdk:3.3.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import io.agora.rtc.RtcEngine
import io.agora.rtc.base.RtcChannelEventHandler
import io.agora.rtc.base.RtcChannelManager
import io.agora.rtc.react.RCTAgoraRtcChannelModule.Companion.REACT_CLASS
import kotlin.reflect.full.declaredMemberFunctions
import kotlin.reflect.jvm.javaMethod

@ReactModule(name = REACT_CLASS)
class RCTAgoraRtcChannelModule(
Expand Down Expand Up @@ -51,8 +49,8 @@ class RCTAgoraRtcChannelModule(

@ReactMethod
fun callMethod(methodName: String, params: ReadableMap?, callback: Promise?) {
manager::class.declaredMemberFunctions.find { it.name == methodName }?.let { function ->
function.javaMethod?.let { method ->
manager.javaClass.declaredMethods.find { it.name == methodName }?.let { function ->
function.let { method ->
try {
val parameters = mutableListOf<Any?>()
params?.toHashMap()?.toMutableMap()?.let {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import io.agora.rtc.RtcEngine
import io.agora.rtc.base.RtcEngineEventHandler
import io.agora.rtc.base.RtcEngineManager
import io.agora.rtc.react.RCTAgoraRtcEngineModule.Companion.REACT_CLASS
import kotlin.reflect.full.declaredMemberFunctions
import kotlin.reflect.jvm.javaMethod

@ReactModule(name = REACT_CLASS)
class RCTAgoraRtcEngineModule(
Expand Down Expand Up @@ -46,8 +44,8 @@ class RCTAgoraRtcEngineModule(

@ReactMethod
fun callMethod(methodName: String, params: ReadableMap?, callback: Promise?) {
manager::class.declaredMemberFunctions.find { it.name == methodName }?.let { function ->
function.javaMethod?.let { method ->
manager.javaClass.declaredMethods.find { it.name == methodName }?.let { function ->
function.let { method ->
try {
val parameters = mutableListOf<Any?>()
params?.toHashMap()?.toMutableMap()?.let {
Expand Down
9 changes: 1 addition & 8 deletions example/src/examples/component/Item.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import React, { useState } from 'react';
import {
Button,
View,
Switch,
StyleSheet,
TouchableOpacity,
Text,
} from 'react-native';
import { View, Switch, StyleSheet, TouchableOpacity, Text } from 'react-native';
import Slider from '@react-native-community/slider';

interface ItemProps {
Expand Down
2 changes: 1 addition & 1 deletion react-native-agora.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ Pod::Spec.new do |s|
s.swift_version = "4.0"

s.dependency "React"
s.dependency "AgoraRtcEngine_iOS", "3.3.1"
s.dependency "AgoraRtcEngine_iOS", "3.3.2"
end

0 comments on commit a391548

Please sign in to comment.