Skip to content

Commit 3bd12aa

Browse files
committed
docs: update docs layout
1 parent 939ce3a commit 3bd12aa

18 files changed

+205
-149
lines changed

docs/plugins/essentials/permissions.md

-62
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
uid: Plugins.Essentials.Permissions
3+
---
4+
5+
# App Permissions
6+
7+
The Permissions API in Prism.Plugin.Essentials allows you to request and check permissions across Android, iOS, MacCatalyst and WinUI on both .NET MAUI and Uno Platform. As with other API's in Prism.Essentials this is automatically registered when Registering Prism Essentials.
8+
9+
## Getting Started
10+
11+
To use the Permissions Manager you can inject the `IPermissionsManager` into your services or ViewModels.
12+
13+
```cs
14+
public class MyViewModel(IPermissionsManager permissions) : BindableBase
15+
{
16+
}
17+
```
18+
19+
To check the state of a given permission you simply need to pass the permission type to the Permission Manager's Check or Request method like:
20+
21+
```cs
22+
var status = await permissions.CheckStatusAsync<LocationAlways>();
23+
24+
if (status != PermissionStatus.NotSupported && status != PermissionStatus.Granted)
25+
{
26+
status = await permissions.RequestAsync<LocationAlways>();
27+
}
28+
```
29+
30+
A permission status of `NotSupported` may be returned when the underlying platform does not require authorization for a specific permission.
31+
32+
## Supported Permissions
33+
34+
| Permission | Android | iOS | MacCatalyst | WinUI |
35+
|------------|:-------:|:---:|:-----------:|:-----:|
36+
| Battery | ![Supported](../../../images/circle_green_checkmark.png) | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) |
37+
| Bluetooth | ![Supported](../../../images/circle_green_checkmark.png) | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) |
38+
| CalendarRead | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Not Supported](../../../images/cross_red_circle.png) |
39+
| CalendarWrite | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Not Supported](../../../images/cross_red_circle.png) |
40+
| Camera | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Not Supported](../../../images/cross_red_circle.png) |
41+
| ContactsRead | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) |
42+
| ContactsWrite | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) |
43+
| Flashlight | ![Supported](../../../images/circle_green_checkmark.png) | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) |
44+
| LaunchApp | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) |
45+
| LocationAlways | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) |
46+
| LocationWhenInUse | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) |
47+
| Maps | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) |
48+
| Media | ![Not Supported](../../../images/cross_red_circle.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Not Supported](../../../images/cross_red_circle.png) |
49+
| Microphone | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Not Supported](../../../images/cross_red_circle.png) |
50+
| NearbyWifiDevices | ![Supported](../../../images/circle_green_checkmark.png) | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) |
51+
| NetworkState | ![Supported](../../../images/circle_green_checkmark.png) | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) |
52+
| Phone | ![Supported](../../../images/circle_green_checkmark.png) | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) |
53+
| Photos | ![Not Supported](../../../images/cross_red_circle.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Not Supported](../../../images/cross_red_circle.png) |
54+
| PhotosAddOnly | ![Not Supported](../../../images/cross_red_circle.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Not Supported](../../../images/cross_red_circle.png) |
55+
| PostNotifications | ![Supported](../../../images/circle_green_checkmark.png) | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) |
56+
| Reminders | ![Not Supported](../../../images/cross_red_circle.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Not Supported](../../../images/cross_red_circle.png) |
57+
| Sensors | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) |
58+
| Sms | ![Supported](../../../images/circle_green_checkmark.png) | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) |
59+
| Speech | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Supported](../../../images/circle_green_checkmark.png) | ![Not Supported](../../../images/cross_red_circle.png) |
60+
| StorageRead | ![Supported](../../../images/circle_green_checkmark.png) | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) |
61+
| StorageWrite | ![Supported](../../../images/circle_green_checkmark.png) | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) |
62+
| Vibrate | ![Supported](../../../images/circle_green_checkmark.png) | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) | ![Not Supported](../../../images/cross_red_circle.png) |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- name: Permissions Manager
2+
href: permissions-manager.md

docs/plugins/essentials/toc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
- name: Notifications
1212
href: notifications/toc.yml
1313
- name: Permissions
14-
href: permissions.md
14+
href: permissions/toc.yml
1515
- name: Threading
1616
href: threading/toc.yml

docs/plugins/logging/index.md

+13-68
Original file line numberDiff line numberDiff line change
@@ -119,71 +119,16 @@ In the above example we can see that we have a single Debug log generated which
119119

120120
Prism provides a number of logging providers available out of the box for you with additional providers currently under consideration. If we do not have integration for a provider that you would like please let us know on Discord.
121121

122-
### AppCenter
123-
124-
As previously mentioned, Prism.Plugin.Logging has a couple of interfaces which help users better map to the sort of calls that you might be used to with the AppCenter SDK. This can really help you in 2 critical ways.
125-
126-
1) By removing the static references to the AppCenter SDK from your codebase, your code becomes easier to manage over time as you have the ability to swap out providers or inject a mock for Unit Testing.
127-
2) Since AppCenter is nearing EOL, it will be critical for businesses to continue using App Center while they evaluate other options. Prism.Plugin.Logging will help you to do just that by combining the AppCenter provider with the AggregateLogger as you evaluate other providers.
128-
129-
```cs
130-
// By Default this registers Analytics and Crashes
131-
containerRegistry.RegisterAppCenterLogger("appSecret");
132-
133-
// If you need to customize the list with other providers
134-
containerRegistry.RegisterAppCenterLogger("appSecret", typeof(Analytics), typeof(Crashes), typeof(Distribution));
135-
```
136-
137-
### Console Logger
138-
139-
By installing the `Prism.Plugin.Logging.Console` package you get access to the generic Console Logger. This will literally call `System.Console.WriteLine` to write logging messages.
140-
141-
```cs
142-
containerRegistry.UsePrismLogging(logging => {
143-
logging.AddConsole();
144-
});
145-
```
146-
147-
### Debug Logger
148-
149-
Similar to the Console Logger is the Debug Logger. This will use `System.Diagnostics.Debug.WriteLine`, and will only write to `Debug.WriteLine` when the Debugger is currently attached. This is a great logger to use for debugging in your IDE and will not produce any logs in the device console if you forget to remove it for production.
150-
151-
```cs
152-
containerRegistry.UsePrismLogging(logging => {
153-
logging.AddDebug();
154-
});
155-
```
156-
157-
### Graylog (GELF)
158-
159-
For more information see the [Gelf docs](xref:Plugins.Logging.Gelf).
160-
161-
### Microsoft.Extensions.Logging Interoperability
162-
163-
For more information see the [Microsoft.Extensions.Logging Interoperability docs](xref:Plugins.Logging.Microsoft).
164-
165-
### Raygun
166-
167-
For more information see the [Prism Logging docs for Raygun](xref:Plugins.Logging.Raygun).
168-
169-
### Sentry
170-
171-
```cs
172-
containerRegistry.UsePrismLogging(logging => {
173-
logging.AddSentry("sentryDsn");
174-
});
175-
```
176-
177-
### Testing
178-
179-
For more information on Unit Testing support see the [Prism.Plugin.Logging.Testing docs](xref:Plugins.Logging.Testing).
180-
181-
### Xunit
182-
183-
Unit testing is critical to catching bugs early. But the logging that you might have in your application you probably don't want to have used in your unit tests. For this reason we have an Xunit provider that enables logging using the ITestOutputHelper. This will help to ensure that logs collected during a unit test are associated with the test and makes it easier to view the logged output from your tests.
184-
185-
```cs
186-
containerRegistry.UsePrismLogging(logging => {
187-
logging.AddXunit(testOutputHelper);
188-
});
189-
```
122+
- [AppCenter](xref:Plugins.Logging.AppCenter)
123+
- [Console](xref:Plugins.Logging.Console)
124+
- [Debug](xref:Plugins.Logging.Debug)
125+
- [Graylog (GELF)](xref:Plugins.Logging.Gelf)
126+
- [Raygun](xref:Plugins.Logging.Raygun)
127+
- [Sentry](xref:Plugins.Logging.Sentry)
128+
- [Testing](xref:Plugins.Logging.Testing)
129+
- [Xunit](xref:Plugins.Logging.Xunit)
130+
131+
## Interop Extensions
132+
133+
- [Microsoft.Extensions.Logging Interoperability](xref:Plugins.Logging.Microsoft)
134+
- [Prism.Plugins.Essentials](xref:Plugins.Logging.Essentials)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
uid: Plugins.Logging.Essentials
3+
---
4+
5+
# Logging Interop with Prism.Plugin.Essentials
6+

0 commit comments

Comments
 (0)