From e4278f5604f7b55f922e2aa565c8fedd62276ceb Mon Sep 17 00:00:00 2001 From: Nagy Szilard Date: Tue, 17 May 2022 16:16:16 +0300 Subject: [PATCH] implement SinchService --- .gitignore | 3 +- App.js | 23 + android/app/src/main/AndroidManifest.xml | 11 +- .../reactnativecallpoc/BaseActivity.java | 98 + .../CallManager/CallManager.java | 105 + .../CallManager/CallManagerPackage.java | 38 + .../com/kadeno/reactnativecallpoc/Hmac.java | 34 + .../com/kadeno/reactnativecallpoc/JWT.java | 73 + .../reactnativecallpoc/MainActivity.java | 17 +- .../reactnativecallpoc/MainApplication.java | 4 +- .../reactnativecallpoc/StartCallActivity.java | 13 + .../sinch/SinchService.java | 312 +- android/app/src/main/res/values/strings.xml | 2 +- package.json | 9 +- src/services/call-manager/CallManager.js | 19 + yarn.lock | 12635 ++++++++-------- 16 files changed, 6950 insertions(+), 6446 deletions(-) create mode 100644 android/app/src/main/java/com/kadeno/reactnativecallpoc/BaseActivity.java create mode 100644 android/app/src/main/java/com/kadeno/reactnativecallpoc/CallManager/CallManager.java create mode 100644 android/app/src/main/java/com/kadeno/reactnativecallpoc/CallManager/CallManagerPackage.java create mode 100644 android/app/src/main/java/com/kadeno/reactnativecallpoc/Hmac.java create mode 100644 android/app/src/main/java/com/kadeno/reactnativecallpoc/JWT.java create mode 100644 android/app/src/main/java/com/kadeno/reactnativecallpoc/StartCallActivity.java create mode 100644 src/services/call-manager/CallManager.js diff --git a/.gitignore b/.gitignore index b8c1bf2..8063266 100644 --- a/.gitignore +++ b/.gitignore @@ -21,7 +21,7 @@ DerivedData *.ipa *.xcuserstate project.xcworkspace - +.env* # Android/IntelliJ # build/ @@ -30,6 +30,7 @@ build/ local.properties *.iml *.hprof +android/app/src/main/assets/config.json # node.js # diff --git a/App.js b/App.js index df4af75..4be4326 100644 --- a/App.js +++ b/App.js @@ -6,11 +6,14 @@ import { View, TouchableOpacity, ScrollView, + TextInput, + Button, } from "react-native"; import uuid from "uuid"; import RNCallKeep from "react-native-callkeep"; import BackgroundTimer from "react-native-background-timer"; import DeviceInfo from "react-native-device-info"; +import CallManager from "./src/services/call-manager/CallManager"; BackgroundTimer.start(); @@ -41,6 +44,7 @@ export default function App() { const [heldCalls, setHeldCalls] = useState({}); // callKeep uuid: held const [mutedCalls, setMutedCalls] = useState({}); // callKeep uuid: muted const [calls, setCalls] = useState({}); // callKeep uuid: number + const [userName, setUserName] = useState(""); const log = (text) => { console.info(text); @@ -253,6 +257,22 @@ export default function App() { Display incoming call now in 3s + + { + setUserName(text); + }} + /> +