Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions docs/maui/essentials/file-saver.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<Permissions.StorageRead>();
var writePermissionsRequest = await Permissions.RequestAsync<Permissions.StorageWrite>();
```

### Save file

```csharp
async Task SaveFile(CancellationToken cancellationToken)
Expand Down
14 changes: 11 additions & 3 deletions docs/maui/essentials/folder-picker.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,19 @@ 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:

```csharp
var readPermissionsRequest = await Permissions.RequestAsync<Permissions.StorageRead>();
```

### Pick folder

```csharp
async Task PickFolder(CancellationToken cancellationToken)
Expand Down
21 changes: 18 additions & 3 deletions docs/maui/essentials/speech-to-text.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool> ArePermissionsGranted(ISpeechToText speechToText)
{
var microphonePermissionStatus = await Permissions.RequestAsync<Permissions.Microphone>();
var isSpeechToTextRequestPermissionsGranted = await speechToText.RequestPermissions(CancellationToken.None);

return microphonePermissionStatus is PermissionStatus.Granted
&& isSpeechToTextRequestPermissionsGranted;
}
```

### Speech To Text

```csharp
async Task StartListening(CancellationToken cancellationToken)
Expand Down
34 changes: 34 additions & 0 deletions docs/maui/views/camera-view.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ The following permissions need to be added to the `Platforms/Android/AndroidMani
<uses-permission android:name="android.permission.CAMERA" />
```

In case you plan to record video, request Microphone permissions:
```xml
<uses-permission android:name="android.permission.RECORD_AUDIO" />
```

This should be added inside the `<manifest>` element. Below shows a more complete example:

```xml
Expand All @@ -34,6 +39,9 @@ This should be added inside the `<manifest>` element. Below shows a more complet

<uses-permission android:name="android.permission.CAMERA" />

<!--Optional. Only for video recording-->
<uses-permission android:name="android.permission.RECORD_AUDIO" />

</manifest>
```

Expand All @@ -46,6 +54,12 @@ The following entries need to be added to the `Platforms/iOS/Info.plist` file:
<string>PROVIDE YOUR REASON HERE</string>
```

In case you plan to record video, request Microphone permissions:
```xml
<key>NSMicrophoneUsageDescription</key>
<string>PROVIDE YOUR REASON HERE</string>
```

This should be added inside the `<dict>` element. Below shows a more complete example:

```xml
Expand Down Expand Up @@ -96,6 +110,12 @@ The following entries need to be added to the `Platforms/MacCatalyst/Info.plist`
<string>PROVIDE YOUR REASON HERE</string>
```

In case you plan to record video, request Microphone permissions:
```xml
<key>NSMicrophoneUsageDescription</key>
<string>PROVIDE YOUR REASON HERE</string>
```

This should be added inside the `<dict>` element. Below shows a more complete example:

```xml
Expand Down Expand Up @@ -155,6 +175,20 @@ 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<Permissions.Camera>();
```

In case you plan to record video, request Microphone permissions:

```csharp
var microphonePermissionsRequest = await Permissions.RequestAsync<Permissions.Microphone>();
```

### Including the XAML namespace

[!INCLUDE [XAML usage guidance](../includes/xaml-usage.md)]
Expand Down