diff --git a/DeviceTests/DeviceTests.Android/DeviceTests.Android.csproj b/DeviceTests/DeviceTests.Android/DeviceTests.Android.csproj
index 71efa7f..07d8b8a 100644
--- a/DeviceTests/DeviceTests.Android/DeviceTests.Android.csproj
+++ b/DeviceTests/DeviceTests.Android/DeviceTests.Android.csproj
@@ -43,6 +43,20 @@
1G
+
+ true
+ pdbonly
+ true
+ bin\Samples
+ prompt
+ 4
+ true
+ false
+ armeabi;armeabi-v7a;x86;x86_64;arm64-v8a
+ true
+ 1G
+
+
diff --git a/DeviceTests/DeviceTests.UWP/DeviceTests.UWP.csproj b/DeviceTests/DeviceTests.UWP/DeviceTests.UWP.csproj
index 6090645..792be1b 100644
--- a/DeviceTests/DeviceTests.UWP/DeviceTests.UWP.csproj
+++ b/DeviceTests/DeviceTests.UWP/DeviceTests.UWP.csproj
@@ -89,6 +89,42 @@
true
true
+
+ bin\ARM\Samples\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008;NU1603
+ pdbonly
+ ARM
+ false
+ prompt
+ true
+ true
+
+
+ bin\x64\Samples\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008;NU1603
+ pdbonly
+ x64
+ false
+ prompt
+ true
+ true
+
+
+ bin\x86\Samples\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008;NU1603
+ pdbonly
+ x86
+ false
+ prompt
+ true
+ true
+
diff --git a/DeviceTests/DeviceTests.iOS/DeviceTests.iOS.csproj b/DeviceTests/DeviceTests.iOS/DeviceTests.iOS.csproj
index fd10680..d23c4b3 100644
--- a/DeviceTests/DeviceTests.iOS/DeviceTests.iOS.csproj
+++ b/DeviceTests/DeviceTests.iOS/DeviceTests.iOS.csproj
@@ -27,6 +27,10 @@
iPhone Developer
Entitlements.plist
+
+
+
+
true
@@ -69,6 +73,36 @@
iPhone Developer
Entitlements.plist
+
+ true
+ pdbonly
+ true
+ bin\iPhoneSimulator\Samples
+ prompt
+ 4
+ SdkOnly
+ x86_64
+ false
+ iPhone Developer
+
+ Entitlements.plist
+ --linkskip=Xamarin.Forms.Platform.iOS --linkskip=Xamarin.Forms.Platform --linkskip=Xamarin.Forms.Core --linkskip=Xamarin.Forms.Xaml
+
+
+ true
+ pdbonly
+ true
+ bin\iPhone\Samples
+ prompt
+ 4
+ ARM64
+ false
+ iPhone Developer
+ Entitlements.plist
+
+
+
+
diff --git a/README.md b/README.md
index 858eb30..188b217 100644
--- a/README.md
+++ b/README.md
@@ -13,6 +13,8 @@ iOS, Android, and UWP offer unique operating system and platform APIs that devel
| Jenkins | Build | Windows | [![Jenkins Build Status](https://jenkins.mono-project.com/buildStatus/icon?job=Components-Essentials)](https://jenkins.mono-project.com/view/Components/job/Components-Essentials/) |
| VSTS | Build | Windows | ![VSTS Build Status](https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/8538/badge) |
| Jenkins | Device Tests | macOS | [![Build Status](https://jenkins.mono-project.com/buildStatus/icon?job=Components-Essentials-DeviceTests-Mac)](https://jenkins.mono-project.com/job/Components-Essentials-DeviceTests-Mac) |
+| App Center | Sample App | Android | [![Build status](https://build.appcenter.ms/v0.1/apps/7a1f46ca-ba2f-477e-aacc-ff013c7d5f7a/branches/master/badge)](https://appcenter.ms) |
+| App Center | Sample App | iOS | [![Build status](https://build.appcenter.ms/v0.1/apps/43b39e9e-2b2b-482f-8afa-e9906334c85e/branches/master/badge)](https://appcenter.ms) |
## Installation
Xamarin.Essentials is available via:
@@ -31,34 +33,35 @@ Xamarin.Essentials is focused on the following platforms:
- Android (4.4+)
- UWP (Fall Creators Update+)
-## Current APIs:
+## API Documentation:
The following cross-platform APIs are available in Xamarin.Essentials:
- - [x] [Accelerometer](https://docs.microsoft.com/xamarin/essentials/accelerometer)
- - [X] [App Information](https://docs.microsoft.com/xamarin/essentials/app-information)
- - [x] [Battery](https://docs.microsoft.com/xamarin/essentials/battery)
- - [x] [Clipboard](https://docs.microsoft.com/xamarin/essentials/clipboard)
- - [x] [Compass](https://docs.microsoft.com/xamarin/essentials/compass)
- - [x] [Connectivity](https://docs.microsoft.com/xamarin/essentials/connectivity)
- - [x] [Data Transfer (Share)](https://docs.microsoft.com/xamarin/essentials/data-transfer)
- - [x] [Device Display Information](https://docs.microsoft.com/en-us/xamarin/essentials/device-display)
- - [x] [Device Information](https://docs.microsoft.com/xamarin/essentials/device-information)
- - [x] [Email](https://docs.microsoft.com/xamarin/essentials/email)
- - [x] [File System Helpers](https://docs.microsoft.com/xamarin/essentials/file-system-helpers)
- - [x] [Flashlight](https://docs.microsoft.com/xamarin/essentials/flashlight)
- - [x] [Geocoding](https://docs.microsoft.com/xamarin/essentials/geocoding)
- - [x] [Geolocation](https://docs.microsoft.com/xamarin/essentials/geolocation)
- - [x] [Gyroscope](https://docs.microsoft.com/xamarin/essentials/gyroscope)
- - [x] [Magnetometer](https://docs.microsoft.com/xamarin/essentials/magnetometer)
- - [x] [Open Browser](https://docs.microsoft.com/xamarin/essentials/open-browser)
- - [x] [Orientation Sensor](https://docs.microsoft.com/en-us/xamarin/essentials/orientation-sensor)
- - [x] [Phone Dialer](https://docs.microsoft.com/xamarin/essentials/phone-dialer)
- - [x] [Preferences](https://docs.microsoft.com/xamarin/essentials/preferences)
- - [x] [Screen Lock](https://docs.microsoft.com/xamarin/essentials/screen-lock)
- - [x] [Secure Storage](https://docs.microsoft.com/xamarin/essentials/secure-storage)
- - [x] [SMS](https://docs.microsoft.com/xamarin/essentials/sms)
- - [x] [Text-to-Speech](https://docs.microsoft.com/xamarin/essentials/text-to-speech)
- - [x] [Version Tracking](https://docs.microsoft.com/xamarin/essentials/version-tracking)
- - [x] [Vibrate](https://docs.microsoft.com/xamarin/essentials/vibrate)
+ - [Accelerometer](https://docs.microsoft.com/xamarin/essentials/accelerometer)
+ - [App Information](https://docs.microsoft.com/xamarin/essentials/app-information)
+ - [Battery](https://docs.microsoft.com/xamarin/essentials/battery)
+ - [Clipboard](https://docs.microsoft.com/xamarin/essentials/clipboard)
+ - [Compass](https://docs.microsoft.com/xamarin/essentials/compass)
+ - [Connectivity](https://docs.microsoft.com/xamarin/essentials/connectivity)
+ - [Data Transfer (Share)](https://docs.microsoft.com/xamarin/essentials/data-transfer)
+ - [Device Display Information](https://docs.microsoft.com/en-us/xamarin/essentials/device-display)
+ - [Device Information](https://docs.microsoft.com/xamarin/essentials/device-information)
+ - [Email](https://docs.microsoft.com/xamarin/essentials/email)
+ - [File System Helpers](https://docs.microsoft.com/xamarin/essentials/file-system-helpers)
+ - [Flashlight](https://docs.microsoft.com/xamarin/essentials/flashlight)
+ - [Geocoding](https://docs.microsoft.com/xamarin/essentials/geocoding)
+ - [Geolocation](https://docs.microsoft.com/xamarin/essentials/geolocation)
+ - [Gyroscope](https://docs.microsoft.com/xamarin/essentials/gyroscope)
+ - [Magnetometer](https://docs.microsoft.com/xamarin/essentials/magnetometer)
+ - [Open Browser](https://docs.microsoft.com/xamarin/essentials/open-browser)
+ - [Orientation Sensor](https://docs.microsoft.com/en-us/xamarin/essentials/orientation-sensor)
+ - [Power](https://docs.microsoft.com/en-us/xamarin/essentials/power)
+ - [Phone Dialer](https://docs.microsoft.com/xamarin/essentials/phone-dialer)
+ - [Preferences](https://docs.microsoft.com/xamarin/essentials/preferences)
+ - [Screen Lock](https://docs.microsoft.com/xamarin/essentials/screen-lock)
+ - [Secure Storage](https://docs.microsoft.com/xamarin/essentials/secure-storage)
+ - [SMS](https://docs.microsoft.com/xamarin/essentials/sms)
+ - [Text-to-Speech](https://docs.microsoft.com/xamarin/essentials/text-to-speech)
+ - [Version Tracking](https://docs.microsoft.com/xamarin/essentials/version-tracking)
+ - [Vibrate](https://docs.microsoft.com/xamarin/essentials/vibrate)
## Contributing
Please read through our [Contribution Guide](CONTRIBUTING.md). We are not accepting new PRs for full features, however any issue that is marked as `up for grabs` are open for community contributions. We encourage creating new issues for bugs found during usage that the team will triage. Additionally, we are open for code refactoring suggestions in PRs.
diff --git a/Samples/Samples.Android/Samples.Android.csproj b/Samples/Samples.Android/Samples.Android.csproj
index a9dce9e..c3e8598 100644
--- a/Samples/Samples.Android/Samples.Android.csproj
+++ b/Samples/Samples.Android/Samples.Android.csproj
@@ -42,6 +42,18 @@
1G
+
+ true
+ pdbonly
+ true
+ bin\Samples
+ prompt
+ 4
+ true
+ false
+
+ 1G
+
diff --git a/Samples/Samples.UWP/Samples.UWP.csproj b/Samples/Samples.UWP/Samples.UWP.csproj
index 5eb3276..def986a 100644
--- a/Samples/Samples.UWP/Samples.UWP.csproj
+++ b/Samples/Samples.UWP/Samples.UWP.csproj
@@ -89,6 +89,42 @@
true
true
+
+ bin\ARM\Samples\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008
+ pdbonly
+ ARM
+ false
+ prompt
+ true
+ true
+
+
+ bin\x64\Samples\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008
+ pdbonly
+ x64
+ false
+ prompt
+ true
+ true
+
+
+ bin\x86\Samples\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008
+ pdbonly
+ x86
+ false
+ prompt
+ true
+ true
+
diff --git a/Samples/Samples.iOS/Samples.iOS.csproj b/Samples/Samples.iOS/Samples.iOS.csproj
index cdcfd18..26f82e1 100644
--- a/Samples/Samples.iOS/Samples.iOS.csproj
+++ b/Samples/Samples.iOS/Samples.iOS.csproj
@@ -26,8 +26,8 @@
true
--linkskip=Xamarin.Forms.Platform.iOS --linkskip=Xamarin.Forms.Platform --linkskip=Xamarin.Forms.Core --linkskip=Xamarin.Forms.Xaml --linkskip=Samples
iPhone Developer
-
Entitlements.plist
+
true
@@ -68,6 +68,29 @@
iPhone Developer
Entitlements.plist
+
+ true
+ pdbonly
+ true
+ bin\iPhoneSimulator\Samples
+ prompt
+ 4
+ None
+ x86_64
+ false
+
+
+ true
+ pdbonly
+ true
+ bin\iPhone\Samples
+ prompt
+ 4
+ ARM64
+ false
+ iPhone Developer
+ Entitlements.plist
+
diff --git a/Samples/Samples/Samples.csproj b/Samples/Samples/Samples.csproj
index 121bb84..720c7a3 100644
--- a/Samples/Samples/Samples.csproj
+++ b/Samples/Samples/Samples.csproj
@@ -1,7 +1,8 @@
-
+
netstandard2.0
+ Debug;Release;Samples
@@ -12,6 +13,10 @@
pdbonly
true
+
+ pdbonly
+ true
+
diff --git a/Samples/Samples/View/AllSensorsPage.xaml b/Samples/Samples/View/AllSensorsPage.xaml
index 5064198..c2444f6 100644
--- a/Samples/Samples/View/AllSensorsPage.xaml
+++ b/Samples/Samples/View/AllSensorsPage.xaml
@@ -1,7 +1,7 @@
@@ -12,7 +12,7 @@
-
+
@@ -46,7 +46,7 @@
-
+
@@ -75,7 +75,7 @@
-
+
@@ -109,7 +109,7 @@
-
+
@@ -143,7 +143,7 @@
-
+
diff --git a/Samples/Samples/View/AllSensorsPage.xaml.cs b/Samples/Samples/View/AllSensorsPage.xaml.cs
index 3846ebc..882e1cf 100644
--- a/Samples/Samples/View/AllSensorsPage.xaml.cs
+++ b/Samples/Samples/View/AllSensorsPage.xaml.cs
@@ -1,4 +1,8 @@
-namespace Samples.View
+using System.Threading.Tasks;
+using Samples.ViewModel;
+using Xamarin.Forms;
+
+namespace Samples.View
{
public partial class AllSensorsPage : BasePage
{
@@ -6,5 +10,27 @@
{
InitializeComponent();
}
+
+ protected override void OnAppearing()
+ {
+ base.OnAppearing();
+
+ SetupBinding(GridAccelerometer.BindingContext);
+ SetupBinding(GridCompass.BindingContext);
+ SetupBinding(GridGyro.BindingContext);
+ SetupBinding(GridMagnetometer.BindingContext);
+ SetupBinding(GridOrientation.BindingContext);
+ }
+
+ protected override void OnDisappearing()
+ {
+ TearDownBinding(GridAccelerometer.BindingContext);
+ TearDownBinding(GridCompass.BindingContext);
+ TearDownBinding(GridGyro.BindingContext);
+ TearDownBinding(GridMagnetometer.BindingContext);
+ TearDownBinding(GridOrientation.BindingContext);
+
+ base.OnDisappearing();
+ }
}
}
diff --git a/Samples/Samples/View/BasePage.cs b/Samples/Samples/View/BasePage.cs
index 2362e28..49e1f41 100644
--- a/Samples/Samples/View/BasePage.cs
+++ b/Samples/Samples/View/BasePage.cs
@@ -15,22 +15,32 @@ namespace Samples.View
{
base.OnAppearing();
- if (BindingContext is BaseViewModel vm)
+ SetupBinding(BindingContext);
+ }
+
+ protected override void OnDisappearing()
+ {
+ TearDownBinding(BindingContext);
+
+ base.OnDisappearing();
+ }
+
+ protected void SetupBinding(object bindingContext)
+ {
+ if (bindingContext is BaseViewModel vm)
{
vm.DoDisplayAlert += OnDisplayAlert;
vm.OnAppearing();
}
}
- protected override void OnDisappearing()
+ protected void TearDownBinding(object bindingContext)
{
- if (BindingContext is BaseViewModel vm)
+ if (bindingContext is BaseViewModel vm)
{
vm.OnDisappearing();
vm.DoDisplayAlert -= OnDisplayAlert;
}
-
- base.OnDisappearing();
}
Task OnDisplayAlert(string message)
diff --git a/Samples/Samples/ViewModel/OrientationSensorViewModel.cs b/Samples/Samples/ViewModel/OrientationSensorViewModel.cs
index 3ec9e8e..29f91f0 100644
--- a/Samples/Samples/ViewModel/OrientationSensorViewModel.cs
+++ b/Samples/Samples/ViewModel/OrientationSensorViewModel.cs
@@ -100,7 +100,7 @@ namespace Samples.ViewModel
void OnStop()
{
IsActive = false;
- Accelerometer.Stop();
+ OrientationSensor.Stop();
}
void OnReadingChanged(OrientationSensorChangedEventArgs e)
diff --git a/Samples/Samples/ViewModel/TextToSpeechViewModel.cs b/Samples/Samples/ViewModel/TextToSpeechViewModel.cs
index 89cc3dd..13a3227 100644
--- a/Samples/Samples/ViewModel/TextToSpeechViewModel.cs
+++ b/Samples/Samples/ViewModel/TextToSpeechViewModel.cs
@@ -77,7 +77,7 @@ namespace Samples.ViewModel
void OnCancel()
{
- if (!IsBusy && !cts.IsCancellationRequested)
+ if (!IsBusy && (cts == null || !cts.IsCancellationRequested))
return;
cts.Cancel();
diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj
index 1a2c5f8..f7ff1e7 100644
--- a/Tests/Tests.csproj
+++ b/Tests/Tests.csproj
@@ -3,10 +3,11 @@
netcoreapp2.0
false
+ Debug;Release;Samples
-
+
diff --git a/Xamarin.Essentials.sln b/Xamarin.Essentials.sln
index 24ddd0b..5179e0e 100644
--- a/Xamarin.Essentials.sln
+++ b/Xamarin.Essentials.sln
@@ -59,6 +59,12 @@ Global
Release|iPhoneSimulator = Release|iPhoneSimulator
Release|x64 = Release|x64
Release|x86 = Release|x86
+ Samples|Any CPU = Samples|Any CPU
+ Samples|ARM = Samples|ARM
+ Samples|iPhone = Samples|iPhone
+ Samples|iPhoneSimulator = Samples|iPhoneSimulator
+ Samples|x64 = Samples|x64
+ Samples|x86 = Samples|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{63A4F6A1-48BF-4D32-AED7-82F605EDB042}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
@@ -85,6 +91,18 @@ Global
{63A4F6A1-48BF-4D32-AED7-82F605EDB042}.Release|x64.Build.0 = Release|Any CPU
{63A4F6A1-48BF-4D32-AED7-82F605EDB042}.Release|x86.ActiveCfg = Release|Any CPU
{63A4F6A1-48BF-4D32-AED7-82F605EDB042}.Release|x86.Build.0 = Release|Any CPU
+ {63A4F6A1-48BF-4D32-AED7-82F605EDB042}.Samples|Any CPU.ActiveCfg = Samples|Any CPU
+ {63A4F6A1-48BF-4D32-AED7-82F605EDB042}.Samples|Any CPU.Build.0 = Samples|Any CPU
+ {63A4F6A1-48BF-4D32-AED7-82F605EDB042}.Samples|ARM.ActiveCfg = Samples|Any CPU
+ {63A4F6A1-48BF-4D32-AED7-82F605EDB042}.Samples|ARM.Build.0 = Samples|Any CPU
+ {63A4F6A1-48BF-4D32-AED7-82F605EDB042}.Samples|iPhone.ActiveCfg = Samples|Any CPU
+ {63A4F6A1-48BF-4D32-AED7-82F605EDB042}.Samples|iPhone.Build.0 = Samples|Any CPU
+ {63A4F6A1-48BF-4D32-AED7-82F605EDB042}.Samples|iPhoneSimulator.ActiveCfg = Samples|Any CPU
+ {63A4F6A1-48BF-4D32-AED7-82F605EDB042}.Samples|iPhoneSimulator.Build.0 = Samples|Any CPU
+ {63A4F6A1-48BF-4D32-AED7-82F605EDB042}.Samples|x64.ActiveCfg = Samples|Any CPU
+ {63A4F6A1-48BF-4D32-AED7-82F605EDB042}.Samples|x64.Build.0 = Samples|Any CPU
+ {63A4F6A1-48BF-4D32-AED7-82F605EDB042}.Samples|x86.ActiveCfg = Samples|Any CPU
+ {63A4F6A1-48BF-4D32-AED7-82F605EDB042}.Samples|x86.Build.0 = Samples|Any CPU
{77C2F93D-6EB7-49F7-A74A-C80499EC206A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{77C2F93D-6EB7-49F7-A74A-C80499EC206A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{77C2F93D-6EB7-49F7-A74A-C80499EC206A}.Debug|ARM.ActiveCfg = Debug|Any CPU
@@ -109,6 +127,17 @@ Global
{77C2F93D-6EB7-49F7-A74A-C80499EC206A}.Release|x64.Build.0 = Release|Any CPU
{77C2F93D-6EB7-49F7-A74A-C80499EC206A}.Release|x86.ActiveCfg = Release|Any CPU
{77C2F93D-6EB7-49F7-A74A-C80499EC206A}.Release|x86.Build.0 = Release|Any CPU
+ {77C2F93D-6EB7-49F7-A74A-C80499EC206A}.Samples|Any CPU.ActiveCfg = Samples|Any CPU
+ {77C2F93D-6EB7-49F7-A74A-C80499EC206A}.Samples|ARM.ActiveCfg = Samples|Any CPU
+ {77C2F93D-6EB7-49F7-A74A-C80499EC206A}.Samples|ARM.Build.0 = Samples|Any CPU
+ {77C2F93D-6EB7-49F7-A74A-C80499EC206A}.Samples|iPhone.ActiveCfg = Samples|Any CPU
+ {77C2F93D-6EB7-49F7-A74A-C80499EC206A}.Samples|iPhone.Build.0 = Samples|Any CPU
+ {77C2F93D-6EB7-49F7-A74A-C80499EC206A}.Samples|iPhoneSimulator.ActiveCfg = Samples|Any CPU
+ {77C2F93D-6EB7-49F7-A74A-C80499EC206A}.Samples|iPhoneSimulator.Build.0 = Samples|Any CPU
+ {77C2F93D-6EB7-49F7-A74A-C80499EC206A}.Samples|x64.ActiveCfg = Samples|Any CPU
+ {77C2F93D-6EB7-49F7-A74A-C80499EC206A}.Samples|x64.Build.0 = Samples|Any CPU
+ {77C2F93D-6EB7-49F7-A74A-C80499EC206A}.Samples|x86.ActiveCfg = Samples|Any CPU
+ {77C2F93D-6EB7-49F7-A74A-C80499EC206A}.Samples|x86.Build.0 = Samples|Any CPU
{2550ED91-8AE1-4E9A-A964-C11515C8FA28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2550ED91-8AE1-4E9A-A964-C11515C8FA28}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2550ED91-8AE1-4E9A-A964-C11515C8FA28}.Debug|ARM.ActiveCfg = Debug|Any CPU
@@ -133,6 +162,18 @@ Global
{2550ED91-8AE1-4E9A-A964-C11515C8FA28}.Release|x64.Build.0 = Release|Any CPU
{2550ED91-8AE1-4E9A-A964-C11515C8FA28}.Release|x86.ActiveCfg = Release|Any CPU
{2550ED91-8AE1-4E9A-A964-C11515C8FA28}.Release|x86.Build.0 = Release|Any CPU
+ {2550ED91-8AE1-4E9A-A964-C11515C8FA28}.Samples|Any CPU.ActiveCfg = Samples|Any CPU
+ {2550ED91-8AE1-4E9A-A964-C11515C8FA28}.Samples|Any CPU.Build.0 = Samples|Any CPU
+ {2550ED91-8AE1-4E9A-A964-C11515C8FA28}.Samples|ARM.ActiveCfg = Samples|Any CPU
+ {2550ED91-8AE1-4E9A-A964-C11515C8FA28}.Samples|ARM.Build.0 = Samples|Any CPU
+ {2550ED91-8AE1-4E9A-A964-C11515C8FA28}.Samples|iPhone.ActiveCfg = Samples|Any CPU
+ {2550ED91-8AE1-4E9A-A964-C11515C8FA28}.Samples|iPhone.Build.0 = Samples|Any CPU
+ {2550ED91-8AE1-4E9A-A964-C11515C8FA28}.Samples|iPhoneSimulator.ActiveCfg = Samples|Any CPU
+ {2550ED91-8AE1-4E9A-A964-C11515C8FA28}.Samples|iPhoneSimulator.Build.0 = Samples|Any CPU
+ {2550ED91-8AE1-4E9A-A964-C11515C8FA28}.Samples|x64.ActiveCfg = Samples|Any CPU
+ {2550ED91-8AE1-4E9A-A964-C11515C8FA28}.Samples|x64.Build.0 = Samples|Any CPU
+ {2550ED91-8AE1-4E9A-A964-C11515C8FA28}.Samples|x86.ActiveCfg = Samples|Any CPU
+ {2550ED91-8AE1-4E9A-A964-C11515C8FA28}.Samples|x86.Build.0 = Samples|Any CPU
{C1CD30D3-52CA-4F8E-8499-BE88567CA2F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C1CD30D3-52CA-4F8E-8499-BE88567CA2F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C1CD30D3-52CA-4F8E-8499-BE88567CA2F8}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
@@ -169,6 +210,24 @@ Global
{C1CD30D3-52CA-4F8E-8499-BE88567CA2F8}.Release|x86.ActiveCfg = Release|Any CPU
{C1CD30D3-52CA-4F8E-8499-BE88567CA2F8}.Release|x86.Build.0 = Release|Any CPU
{C1CD30D3-52CA-4F8E-8499-BE88567CA2F8}.Release|x86.Deploy.0 = Release|Any CPU
+ {C1CD30D3-52CA-4F8E-8499-BE88567CA2F8}.Samples|Any CPU.ActiveCfg = Samples|Any CPU
+ {C1CD30D3-52CA-4F8E-8499-BE88567CA2F8}.Samples|Any CPU.Build.0 = Samples|Any CPU
+ {C1CD30D3-52CA-4F8E-8499-BE88567CA2F8}.Samples|Any CPU.Deploy.0 = Samples|Any CPU
+ {C1CD30D3-52CA-4F8E-8499-BE88567CA2F8}.Samples|ARM.ActiveCfg = Samples|Any CPU
+ {C1CD30D3-52CA-4F8E-8499-BE88567CA2F8}.Samples|ARM.Build.0 = Samples|Any CPU
+ {C1CD30D3-52CA-4F8E-8499-BE88567CA2F8}.Samples|ARM.Deploy.0 = Samples|Any CPU
+ {C1CD30D3-52CA-4F8E-8499-BE88567CA2F8}.Samples|iPhone.ActiveCfg = Samples|Any CPU
+ {C1CD30D3-52CA-4F8E-8499-BE88567CA2F8}.Samples|iPhone.Build.0 = Samples|Any CPU
+ {C1CD30D3-52CA-4F8E-8499-BE88567CA2F8}.Samples|iPhone.Deploy.0 = Samples|Any CPU
+ {C1CD30D3-52CA-4F8E-8499-BE88567CA2F8}.Samples|iPhoneSimulator.ActiveCfg = Samples|Any CPU
+ {C1CD30D3-52CA-4F8E-8499-BE88567CA2F8}.Samples|iPhoneSimulator.Build.0 = Samples|Any CPU
+ {C1CD30D3-52CA-4F8E-8499-BE88567CA2F8}.Samples|iPhoneSimulator.Deploy.0 = Samples|Any CPU
+ {C1CD30D3-52CA-4F8E-8499-BE88567CA2F8}.Samples|x64.ActiveCfg = Samples|Any CPU
+ {C1CD30D3-52CA-4F8E-8499-BE88567CA2F8}.Samples|x64.Build.0 = Samples|Any CPU
+ {C1CD30D3-52CA-4F8E-8499-BE88567CA2F8}.Samples|x64.Deploy.0 = Samples|Any CPU
+ {C1CD30D3-52CA-4F8E-8499-BE88567CA2F8}.Samples|x86.ActiveCfg = Samples|Any CPU
+ {C1CD30D3-52CA-4F8E-8499-BE88567CA2F8}.Samples|x86.Build.0 = Samples|Any CPU
+ {C1CD30D3-52CA-4F8E-8499-BE88567CA2F8}.Samples|x86.Deploy.0 = Samples|Any CPU
{E2571C97-C048-4F91-8BB3-546CF7410C4C}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
{E2571C97-C048-4F91-8BB3-546CF7410C4C}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
{E2571C97-C048-4F91-8BB3-546CF7410C4C}.Debug|ARM.ActiveCfg = Debug|iPhone
@@ -193,6 +252,15 @@ Global
{E2571C97-C048-4F91-8BB3-546CF7410C4C}.Release|x64.Build.0 = Release|iPhoneSimulator
{E2571C97-C048-4F91-8BB3-546CF7410C4C}.Release|x86.ActiveCfg = Release|iPhoneSimulator
{E2571C97-C048-4F91-8BB3-546CF7410C4C}.Release|x86.Build.0 = Release|iPhoneSimulator
+ {E2571C97-C048-4F91-8BB3-546CF7410C4C}.Samples|Any CPU.ActiveCfg = Samples|iPhone
+ {E2571C97-C048-4F91-8BB3-546CF7410C4C}.Samples|Any CPU.Build.0 = Samples|iPhone
+ {E2571C97-C048-4F91-8BB3-546CF7410C4C}.Samples|ARM.ActiveCfg = Samples|iPhone
+ {E2571C97-C048-4F91-8BB3-546CF7410C4C}.Samples|iPhone.ActiveCfg = Samples|iPhone
+ {E2571C97-C048-4F91-8BB3-546CF7410C4C}.Samples|iPhone.Build.0 = Samples|iPhone
+ {E2571C97-C048-4F91-8BB3-546CF7410C4C}.Samples|iPhoneSimulator.ActiveCfg = Samples|iPhoneSimulator
+ {E2571C97-C048-4F91-8BB3-546CF7410C4C}.Samples|iPhoneSimulator.Build.0 = Samples|iPhoneSimulator
+ {E2571C97-C048-4F91-8BB3-546CF7410C4C}.Samples|x64.ActiveCfg = Samples|iPhone
+ {E2571C97-C048-4F91-8BB3-546CF7410C4C}.Samples|x86.ActiveCfg = Samples|iPhone
{A0798FC9-AB9D-4CCA-AF44-71B7A4691D5A}.Debug|Any CPU.ActiveCfg = Debug|x86
{A0798FC9-AB9D-4CCA-AF44-71B7A4691D5A}.Debug|Any CPU.Build.0 = Debug|x86
{A0798FC9-AB9D-4CCA-AF44-71B7A4691D5A}.Debug|Any CPU.Deploy.0 = Debug|x86
@@ -229,6 +297,20 @@ Global
{A0798FC9-AB9D-4CCA-AF44-71B7A4691D5A}.Release|x86.ActiveCfg = Release|x86
{A0798FC9-AB9D-4CCA-AF44-71B7A4691D5A}.Release|x86.Build.0 = Release|x86
{A0798FC9-AB9D-4CCA-AF44-71B7A4691D5A}.Release|x86.Deploy.0 = Release|x86
+ {A0798FC9-AB9D-4CCA-AF44-71B7A4691D5A}.Samples|Any CPU.ActiveCfg = Samples|x86
+ {A0798FC9-AB9D-4CCA-AF44-71B7A4691D5A}.Samples|Any CPU.Build.0 = Samples|x86
+ {A0798FC9-AB9D-4CCA-AF44-71B7A4691D5A}.Samples|Any CPU.Deploy.0 = Samples|x86
+ {A0798FC9-AB9D-4CCA-AF44-71B7A4691D5A}.Samples|ARM.ActiveCfg = Samples|ARM
+ {A0798FC9-AB9D-4CCA-AF44-71B7A4691D5A}.Samples|ARM.Build.0 = Samples|ARM
+ {A0798FC9-AB9D-4CCA-AF44-71B7A4691D5A}.Samples|ARM.Deploy.0 = Samples|ARM
+ {A0798FC9-AB9D-4CCA-AF44-71B7A4691D5A}.Samples|iPhone.ActiveCfg = Samples|x86
+ {A0798FC9-AB9D-4CCA-AF44-71B7A4691D5A}.Samples|iPhoneSimulator.ActiveCfg = Samples|x86
+ {A0798FC9-AB9D-4CCA-AF44-71B7A4691D5A}.Samples|x64.ActiveCfg = Samples|x64
+ {A0798FC9-AB9D-4CCA-AF44-71B7A4691D5A}.Samples|x64.Build.0 = Samples|x64
+ {A0798FC9-AB9D-4CCA-AF44-71B7A4691D5A}.Samples|x64.Deploy.0 = Samples|x64
+ {A0798FC9-AB9D-4CCA-AF44-71B7A4691D5A}.Samples|x86.ActiveCfg = Samples|x86
+ {A0798FC9-AB9D-4CCA-AF44-71B7A4691D5A}.Samples|x86.Build.0 = Samples|x86
+ {A0798FC9-AB9D-4CCA-AF44-71B7A4691D5A}.Samples|x86.Deploy.0 = Samples|x86
{CB2072E0-A437-4811-AE17-16CAE0DDA1B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB2072E0-A437-4811-AE17-16CAE0DDA1B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB2072E0-A437-4811-AE17-16CAE0DDA1B1}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
@@ -265,6 +347,22 @@ Global
{CB2072E0-A437-4811-AE17-16CAE0DDA1B1}.Release|x86.ActiveCfg = Release|Any CPU
{CB2072E0-A437-4811-AE17-16CAE0DDA1B1}.Release|x86.Build.0 = Release|Any CPU
{CB2072E0-A437-4811-AE17-16CAE0DDA1B1}.Release|x86.Deploy.0 = Release|Any CPU
+ {CB2072E0-A437-4811-AE17-16CAE0DDA1B1}.Samples|Any CPU.ActiveCfg = Samples|Any CPU
+ {CB2072E0-A437-4811-AE17-16CAE0DDA1B1}.Samples|ARM.ActiveCfg = Samples|Any CPU
+ {CB2072E0-A437-4811-AE17-16CAE0DDA1B1}.Samples|ARM.Build.0 = Samples|Any CPU
+ {CB2072E0-A437-4811-AE17-16CAE0DDA1B1}.Samples|ARM.Deploy.0 = Samples|Any CPU
+ {CB2072E0-A437-4811-AE17-16CAE0DDA1B1}.Samples|iPhone.ActiveCfg = Samples|Any CPU
+ {CB2072E0-A437-4811-AE17-16CAE0DDA1B1}.Samples|iPhone.Build.0 = Samples|Any CPU
+ {CB2072E0-A437-4811-AE17-16CAE0DDA1B1}.Samples|iPhone.Deploy.0 = Samples|Any CPU
+ {CB2072E0-A437-4811-AE17-16CAE0DDA1B1}.Samples|iPhoneSimulator.ActiveCfg = Samples|Any CPU
+ {CB2072E0-A437-4811-AE17-16CAE0DDA1B1}.Samples|iPhoneSimulator.Build.0 = Samples|Any CPU
+ {CB2072E0-A437-4811-AE17-16CAE0DDA1B1}.Samples|iPhoneSimulator.Deploy.0 = Samples|Any CPU
+ {CB2072E0-A437-4811-AE17-16CAE0DDA1B1}.Samples|x64.ActiveCfg = Samples|Any CPU
+ {CB2072E0-A437-4811-AE17-16CAE0DDA1B1}.Samples|x64.Build.0 = Samples|Any CPU
+ {CB2072E0-A437-4811-AE17-16CAE0DDA1B1}.Samples|x64.Deploy.0 = Samples|Any CPU
+ {CB2072E0-A437-4811-AE17-16CAE0DDA1B1}.Samples|x86.ActiveCfg = Samples|Any CPU
+ {CB2072E0-A437-4811-AE17-16CAE0DDA1B1}.Samples|x86.Build.0 = Samples|Any CPU
+ {CB2072E0-A437-4811-AE17-16CAE0DDA1B1}.Samples|x86.Deploy.0 = Samples|Any CPU
{EE8FC716-27FC-405B-BD27-AF17E01A6671}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
{EE8FC716-27FC-405B-BD27-AF17E01A6671}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
{EE8FC716-27FC-405B-BD27-AF17E01A6671}.Debug|ARM.ActiveCfg = Debug|iPhone
@@ -289,6 +387,14 @@ Global
{EE8FC716-27FC-405B-BD27-AF17E01A6671}.Release|x64.Build.0 = Release|iPhoneSimulator
{EE8FC716-27FC-405B-BD27-AF17E01A6671}.Release|x86.ActiveCfg = Release|iPhoneSimulator
{EE8FC716-27FC-405B-BD27-AF17E01A6671}.Release|x86.Build.0 = Release|iPhoneSimulator
+ {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Samples|Any CPU.ActiveCfg = Samples|iPhone
+ {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Samples|ARM.ActiveCfg = Samples|iPhone
+ {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Samples|iPhone.ActiveCfg = Samples|iPhone
+ {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Samples|iPhone.Build.0 = Samples|iPhone
+ {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Samples|iPhoneSimulator.ActiveCfg = Samples|iPhoneSimulator
+ {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Samples|iPhoneSimulator.Build.0 = Samples|iPhoneSimulator
+ {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Samples|x64.ActiveCfg = Samples|iPhone
+ {EE8FC716-27FC-405B-BD27-AF17E01A6671}.Samples|x86.ActiveCfg = Samples|iPhone
{4BD0D88F-7E7A-4C3B-9E34-BF3717A8FF4B}.Debug|Any CPU.ActiveCfg = Debug|x86
{4BD0D88F-7E7A-4C3B-9E34-BF3717A8FF4B}.Debug|Any CPU.Build.0 = Debug|x86
{4BD0D88F-7E7A-4C3B-9E34-BF3717A8FF4B}.Debug|Any CPU.Deploy.0 = Debug|x86
@@ -325,6 +431,18 @@ Global
{4BD0D88F-7E7A-4C3B-9E34-BF3717A8FF4B}.Release|x86.ActiveCfg = Release|x86
{4BD0D88F-7E7A-4C3B-9E34-BF3717A8FF4B}.Release|x86.Build.0 = Release|x86
{4BD0D88F-7E7A-4C3B-9E34-BF3717A8FF4B}.Release|x86.Deploy.0 = Release|x86
+ {4BD0D88F-7E7A-4C3B-9E34-BF3717A8FF4B}.Samples|Any CPU.ActiveCfg = Samples|x86
+ {4BD0D88F-7E7A-4C3B-9E34-BF3717A8FF4B}.Samples|ARM.ActiveCfg = Samples|ARM
+ {4BD0D88F-7E7A-4C3B-9E34-BF3717A8FF4B}.Samples|ARM.Build.0 = Samples|ARM
+ {4BD0D88F-7E7A-4C3B-9E34-BF3717A8FF4B}.Samples|ARM.Deploy.0 = Samples|ARM
+ {4BD0D88F-7E7A-4C3B-9E34-BF3717A8FF4B}.Samples|iPhone.ActiveCfg = Samples|x86
+ {4BD0D88F-7E7A-4C3B-9E34-BF3717A8FF4B}.Samples|iPhoneSimulator.ActiveCfg = Samples|x86
+ {4BD0D88F-7E7A-4C3B-9E34-BF3717A8FF4B}.Samples|x64.ActiveCfg = Samples|x64
+ {4BD0D88F-7E7A-4C3B-9E34-BF3717A8FF4B}.Samples|x64.Build.0 = Samples|x64
+ {4BD0D88F-7E7A-4C3B-9E34-BF3717A8FF4B}.Samples|x64.Deploy.0 = Samples|x64
+ {4BD0D88F-7E7A-4C3B-9E34-BF3717A8FF4B}.Samples|x86.ActiveCfg = Samples|x86
+ {4BD0D88F-7E7A-4C3B-9E34-BF3717A8FF4B}.Samples|x86.Build.0 = Samples|x86
+ {4BD0D88F-7E7A-4C3B-9E34-BF3717A8FF4B}.Samples|x86.Deploy.0 = Samples|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/Xamarin.Essentials/Permissions/Permissions.ios.cs b/Xamarin.Essentials/Permissions/Permissions.ios.cs
index 1b97255..408660b 100644
--- a/Xamarin.Essentials/Permissions/Permissions.ios.cs
+++ b/Xamarin.Essentials/Permissions/Permissions.ios.cs
@@ -32,9 +32,10 @@ namespace Xamarin.Essentials
static async Task PlatformRequestAsync(PermissionType permission)
{
- // Check status before requesting first
- if (await PlatformCheckStatusAsync(permission) == PermissionStatus.Granted)
- return PermissionStatus.Granted;
+ // Check status before requesting first and only request if Unknown
+ var status = await PlatformCheckStatusAsync(permission);
+ if (status != PermissionStatus.Unknown)
+ return status;
EnsureDeclared(permission);
diff --git a/Xamarin.Essentials/Xamarin.Essentials.csproj b/Xamarin.Essentials/Xamarin.Essentials.csproj
index 4b2dba1..af7ba34 100644
--- a/Xamarin.Essentials/Xamarin.Essentials.csproj
+++ b/Xamarin.Essentials/Xamarin.Essentials.csproj
@@ -31,6 +31,7 @@
true
https://go.microsoft.com/fwlink/?linkid=868960
$(MSBuildThisFileDirectory)..\docs\en
+ Debug;Release;Samples
full
@@ -39,9 +40,12 @@
pdbonly
+
+ pdbonly
+
-
-
+
+