Skip to content

Instantly share code, notes, and snippets.

@codemillmatt
Created April 24, 2020 22:01
Show Gist options
  • Save codemillmatt/a6a68e8ce4c0d4bdb65664ee21d07cbe to your computer and use it in GitHub Desktop.
Save codemillmatt/a6a68e8ce4c0d4bdb65664ee21d07cbe to your computer and use it in GitHub Desktop.
Prompt for microphone permissions
public async Task<PermissionStatus> CheckAndRequestMicrophonePermission()
{
var status = await Permissions.CheckStatusAsync<Permissions.Microphone>();
if (status != PermissionStatus.Granted)
{
status = await Permissions.RequestAsync<Permissions.Microphone>();
}
return status;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment