From 86932e66027e8fd88af340b9bec4819349246f8b Mon Sep 17 00:00:00 2001 From: Vladislav Antonyuk Date: Wed, 12 Nov 2025 11:13:15 +0200 Subject: [PATCH 1/2] Allow Developers to Manually Request Permissions when using CameraView, FileSaver, FolderPicker and SpeechToText --- docs/maui/essentials/file-saver.md | 15 ++++++++++++--- docs/maui/essentials/folder-picker.md | 17 ++++++++++++++--- docs/maui/essentials/speech-to-text.md | 21 ++++++++++++++++++--- docs/maui/views/camera-view.md | 13 +++++++++++++ 4 files changed, 57 insertions(+), 9 deletions(-) diff --git a/docs/maui/essentials/file-saver.md b/docs/maui/essentials/file-saver.md index 48815aabe..db137b4c6 100644 --- a/docs/maui/essentials/file-saver.md +++ b/docs/maui/essentials/file-saver.md @@ -72,11 +72,20 @@ Add permissions to `tizen-manifest.xml`: --- -## Syntax +## Basic usage -### C# +The `FileSaver` can be added to a .NET MAUI application in the following way. -The `FileSaver` can be used as follows in C#: +### Request permissions + +Developers must manually request Permissions.StorageRead and Permissions.StorageWrite: + +```csharp +var readPermissionsRequest = await Permissions.RequestAsync(); +var writePermissionsRequest = await Permissions.RequestAsync(); +``` + +### Save file ```csharp async Task SaveFile(CancellationToken cancellationToken) diff --git a/docs/maui/essentials/folder-picker.md b/docs/maui/essentials/folder-picker.md index 85598cae8..84293ba63 100644 --- a/docs/maui/essentials/folder-picker.md +++ b/docs/maui/essentials/folder-picker.md @@ -65,11 +65,22 @@ Add permissions to `tizen-manifest.xml`: --- -## Syntax +## Basic usage -### C# +The `FolderPicker` can be added to a .NET MAUI application in the following way. -The `FolderPicker` can be used as follows in C#: +### Request permissions + +Developers must manually request Permissions.StorageRead and/or Permissions.StorageWrite: + +```csharp +var readPermissionsRequest = await Permissions.RequestAsync(); +var writePermissionsRequest = await Permissions.RequestAsync(); +``` + +StorageWrite permission is required in case you plan to write something in the folder. + +### Pick folder ```csharp async Task PickFolder(CancellationToken cancellationToken) diff --git a/docs/maui/essentials/speech-to-text.md b/docs/maui/essentials/speech-to-text.md index 999f2c752..3b8c16fef 100644 --- a/docs/maui/essentials/speech-to-text.md +++ b/docs/maui/essentials/speech-to-text.md @@ -55,11 +55,26 @@ Add permissions to `tizen-manifest.xml`: --- -## Syntax +## Basic usages -### C# +The `SpeechToText` can be added to a .NET MAUI application in the following way. -The `SpeechToText` can be used as follows in C#: +### Request permissions + +Developers must manually request permissions for Permissions.Microphone and manually call ISpeechToText.RequestPermissions(): + +```csharp +static async Task ArePermissionsGranted(ISpeechToText speechToText) +{ + var microphonePermissionStatus = await Permissions.RequestAsync(); + var isSpeechToTextRequestPermissionsGranted = await speechToText.RequestPermissions(CancellationToken.None); + + return microphonePermissionStatus is PermissionStatus.Granted + && isSpeechToTextRequestPermissionsGranted; +} +``` + +### Speech To Text ```csharp async Task StartListening(CancellationToken cancellationToken) diff --git a/docs/maui/views/camera-view.md b/docs/maui/views/camera-view.md index b94482c33..f018b5134 100644 --- a/docs/maui/views/camera-view.md +++ b/docs/maui/views/camera-view.md @@ -155,6 +155,19 @@ Tizen is not currently supported. The `CameraView` can be added to a .NET MAUI application in the following way. +### Request permissions + +Developers must manually request Permissions.Camera and/or Permissions.Microphone: + +```csharp +var cameraPermissionsRequest = await Permissions.RequestAsync(); +var microphonePermissionsRequest = await Permissions.RequestAsync(); +``` + +Camera permission is always required. + +Microphone Permission is required if you plan to use video recording. + ### Including the XAML namespace [!INCLUDE [XAML usage guidance](../includes/xaml-usage.md)] From a6d2eb88e3564cac8a2a21c45e2a575300f035a8 Mon Sep 17 00:00:00 2001 From: Vladislav Antonyuk Date: Fri, 14 Nov 2025 17:12:03 +0200 Subject: [PATCH 2/2] update docs to split required and optional permissions --- docs/maui/essentials/folder-picker.md | 5 +---- docs/maui/views/camera-view.md | 27 ++++++++++++++++++++++++--- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/docs/maui/essentials/folder-picker.md b/docs/maui/essentials/folder-picker.md index 84293ba63..4186d73cc 100644 --- a/docs/maui/essentials/folder-picker.md +++ b/docs/maui/essentials/folder-picker.md @@ -71,15 +71,12 @@ The `FolderPicker` can be added to a .NET MAUI application in the following way. ### Request permissions -Developers must manually request Permissions.StorageRead and/or Permissions.StorageWrite: +Developers must manually request Permissions.StorageRead: ```csharp var readPermissionsRequest = await Permissions.RequestAsync(); -var writePermissionsRequest = await Permissions.RequestAsync(); ``` -StorageWrite permission is required in case you plan to write something in the folder. - ### Pick folder ```csharp diff --git a/docs/maui/views/camera-view.md b/docs/maui/views/camera-view.md index f018b5134..c8943323d 100644 --- a/docs/maui/views/camera-view.md +++ b/docs/maui/views/camera-view.md @@ -25,6 +25,11 @@ The following permissions need to be added to the `Platforms/Android/AndroidMani ``` +In case you plan to record video, request Microphone permissions: +```xml + +``` + This should be added inside the `` element. Below shows a more complete example: ```xml @@ -34,6 +39,9 @@ This should be added inside the `` element. Below shows a more complet + + + ``` @@ -46,6 +54,12 @@ The following entries need to be added to the `Platforms/iOS/Info.plist` file: PROVIDE YOUR REASON HERE ``` +In case you plan to record video, request Microphone permissions: +```xml +NSMicrophoneUsageDescription +PROVIDE YOUR REASON HERE +``` + This should be added inside the `` element. Below shows a more complete example: ```xml @@ -96,6 +110,12 @@ The following entries need to be added to the `Platforms/MacCatalyst/Info.plist` PROVIDE YOUR REASON HERE ``` +In case you plan to record video, request Microphone permissions: +```xml +NSMicrophoneUsageDescription +PROVIDE YOUR REASON HERE +``` + This should be added inside the `` element. Below shows a more complete example: ```xml @@ -161,12 +181,13 @@ Developers must manually request Permissions.Camera and/or Permissions.Microphon ```csharp var cameraPermissionsRequest = await Permissions.RequestAsync(); -var microphonePermissionsRequest = await Permissions.RequestAsync(); ``` -Camera permission is always required. +In case you plan to record video, request Microphone permissions: -Microphone Permission is required if you plan to use video recording. +```csharp +var microphonePermissionsRequest = await Permissions.RequestAsync(); +``` ### Including the XAML namespace