Browse Source

Fix a bug preventing [SupportedOSPlatform] from being correctly set

pull/2113/head
Kévin Chalet 2 years ago
parent
commit
aec8fdc61c
  1. 4
      Directory.Build.props
  2. 6
      Directory.Build.targets
  3. 4
      src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHelpers.cs

4
Directory.Build.props

@ -95,10 +95,6 @@
Condition=" '$(UniversalWindowsPlatformTargetFrameworks)' == '' And '$(SupportsUniversalWindowsPlatformTargeting)' == 'true' "> Condition=" '$(UniversalWindowsPlatformTargetFrameworks)' == '' And '$(SupportsUniversalWindowsPlatformTargeting)' == 'true' ">
uap10.0.17763 uap10.0.17763
</UniversalWindowsPlatformTargetFrameworks> </UniversalWindowsPlatformTargetFrameworks>
<SupportedOSPlatformVersion Condition=" '$(TargetPlatformIdentifier)' == 'iOS' ">12.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition=" '$(TargetPlatformIdentifier)' == 'Windows' ">7.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition=" '$(TargetPlatformIdentifier)' == 'Windows' ">7.0</TargetPlatformMinVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>

6
Directory.Build.targets

@ -15,6 +15,12 @@
<PublicSign>false</PublicSign> <PublicSign>false</PublicSign>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<SupportedOSPlatformVersion Condition=" '$(TargetPlatformIdentifier)' == 'iOS' ">12.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition=" '$(TargetPlatformIdentifier)' == 'Windows' ">7.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition=" '$(TargetPlatformIdentifier)' == 'Windows' ">7.0</TargetPlatformMinVersion>
</PropertyGroup>
<!-- <!--
Note: .NET Framework and .NET Core <3.0/.NET Standard assemblies are not annotated Note: .NET Framework and .NET Core <3.0/.NET Standard assemblies are not annotated
with nullable references annotations. To avoid errors on these target frameworks, with nullable references annotations. To avoid errors on these target frameworks,

4
src/OpenIddict.Client.SystemIntegration/OpenIddictClientSystemIntegrationHelpers.cs

@ -273,10 +273,12 @@ public static class OpenIddictClientSystemIntegrationHelpers
{ {
try try
{ {
#pragma warning disable CA1416
using var scenes = UIApplication.SharedApplication.ConnectedScenes; using var scenes = UIApplication.SharedApplication.ConnectedScenes;
var scene = scenes.ToArray<UIWindowScene>().FirstOrDefault(); var scene = scenes.ToArray<UIWindowScene>().FirstOrDefault();
return scene?.Windows.FirstOrDefault(); return scene?.Windows.FirstOrDefault();
#pragma warning restore CA1416
} }
catch (InvalidCastException) catch (InvalidCastException)
@ -294,10 +296,12 @@ public static class OpenIddictClientSystemIntegrationHelpers
{ {
try try
{ {
#pragma warning disable CA1416
using var scenes = UIApplication.SharedApplication.ConnectedScenes; using var scenes = UIApplication.SharedApplication.ConnectedScenes;
var scene = scenes.ToArray<UIWindowScene>().FirstOrDefault(); var scene = scenes.ToArray<UIWindowScene>().FirstOrDefault();
return scene?.Windows; return scene?.Windows;
#pragma warning restore CA1416
} }
catch (InvalidCastException) catch (InvalidCastException)

Loading…
Cancel
Save