CallPermissions class
Utility to request microphone/camera permissions before starting a call.
On Android 6+ and iOS, microphone and camera access are runtime
permissions that must be granted before WebRTC can access the hardware.
Without this, the Calls SDK throws SecurityError: Permission denied
when creating audio/video tracks.
On Web, the browser handles permissions via its own getUserMedia prompt
when the WebRTC session starts — native permission_handler is not
supported. We return true immediately on web.
The UI Kit's call components ask through the same check, so a call
placed or answered from them and one an app starts after this answers
true need exactly the same permissions. They also tell a permanent
refusal apart, which they report to onError as
PERMISSION_PERMANENTLY_DENIED.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
requestForCallType(
{required bool isVideoCall}) → Future< bool> -
Request the appropriate permissions for a call type.
isVideoCall— if true, requests both microphone and camera. -
requestMicrophone(
) → Future< bool> -
Request microphone permission (audio calls).
Returns
trueif granted or already granted. -
requestMicrophoneAndCamera(
) → Future< bool> -
Request microphone + camera permissions (video calls).
Returns
trueif both are granted.