ConnectyCube / connectycube-flutter-sdk-releases

ConnectyCube Flutter SDK Releases
7 stars 1 forks source link

Trigger permission request without a call? #41

Closed sowens-csd closed 3 years ago

sowens-csd commented 3 years ago

Is your feature request related to a problem? Please describe. I need to control when users are asked for system permission to use the camera and microphone because they frequently reject permissions if they don't understand why they are being asked. Usually we put up an app dialog explaining why permissions will be required before the first time a user uses a feature. The dialog would have a button that triggers the request for permissions. Users are then prepared for the request and can respond in context.

Describe the solution you'd like I would like a method that would ask for platform permissions without having to start a video call. The method should return whether the permission was granted or not. There should also be a second method that returns whether permission has already been granted or not. For example:

if ( connecty.hasNoPermission ) {
  bool hasPermission = await connecty.requestPermissions();
}

hasNoPermission would return false both when the user has not yet been asked and when they have been asked but have rejected permissions. requestPermissions would probably be a no-op once the user has been asked because generally the system won't ask the user again.

Describe alternatives you've considered I tried placing a video call to an unknown user (userID 1) but it doesn't seem to work.

Additional context

TatankaConCube commented 3 years ago

For this functionality, you can use a third-party plugin and check permissions before starting the call (for example, after a click on the 'Call' button). We don't manage permissions in our SDK, flutter_webrtc does it by himself.