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" /> +