From a4f6b16a8510eb263a419864f0471584b9332f22 Mon Sep 17 00:00:00 2001 From: CSantos <4a.santos@gmail.com> Date: Wed, 22 May 2019 14:04:23 +0200 Subject: [PATCH] Updated openvidu-react-native --- openvidu-react-native/App.js | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/openvidu-react-native/App.js b/openvidu-react-native/App.js index 54cf648d..6922e942 100644 --- a/openvidu-react-native/App.js +++ b/openvidu-react-native/App.js @@ -128,8 +128,8 @@ export default class App extends Component { mySession .connect(token, { clientData: this.state.myUserName }) .then(() => { - console.log('SESSION CONNECTED'); - if (Platform.OS === 'android'); { + console.log('SESSION CONNECTED', Platform); + if (Platform.OS == 'android') { this.checkAndroidPermissions(); } @@ -197,15 +197,18 @@ export default class App extends Component { } // Empty all properties... - this.OV = null; - this.setState({ - session: undefined, - subscribers: [], - mySessionId: 'SessionA', - myUserName: 'Participant' + Math.floor(Math.random() * 100), - mainStreamManager: undefined, - publisher: undefined, - }); + setTimeout(() => { + this.OV = null; + this.setState({ + session: undefined, + subscribers: [], + mySessionId: 'SessionA', + myUserName: 'Participant' + Math.floor(Math.random() * 100), + mainStreamManager: undefined, + publisher: undefined, + }); + }) + } toggleCamera(){ @@ -237,6 +240,12 @@ export default class App extends Component { title="Toggle Camera" color="#841584" /> +