blackuy / react-native-twilio-video-webrtc

Twilio Video (WebRTC) for React Native
https://www.twilio.com/docs/video
MIT License
609 stars 404 forks source link

Android app must be restarted to acknowledge camera permissions #564

Closed tylers-username closed 3 years ago

tylers-username commented 3 years ago

Steps to reproduce

  1. Install the latest master branch package
  2. Do not attempt to call reat-native-twilio-video-webrtc components at all until permissions have been confirmed

Expected behaviour

iOS & Android should be ready to use immediately after permissions have been granted

Actual behaviour

iOS works but the Android app must be restarted

Environment

react-native-twilio-video-webrtc

Version: "master" ("react-native-twilio-video-webrtc": "https://github.com/blackuy/react-native-twilio-video-webrtc"

slycoder commented 3 years ago

Does it suffice to unmount and remount the TwilioVideo component?

tylers-username commented 3 years ago

At your prompt, I couldn't imagine how on earth my Twilio components could be called prior to permissions being granted. Apparently, React doesn't care what my imagination is capable of.

That was the issue. While permissions were being checked, React was sneaking past my permissions firewall and making a call to my Twilio components. This did not bug out my app on iOS, once permissions were granted, iOS does its thing and renders the video. However, it seems that if you try to load Twilio when video permissions have not been granted the app must be restarted (hot reloading and refreshing didn't do the trick for me).

The component could never get past this line of code.

Balasnest commented 3 years ago

@slycoder @tylerssn what is the resolution for this issue?

tylers-username commented 3 years ago

@Balasnest you need to make sure that the component is not called at all until video and mic permissions have been granted.