Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
14 changes: 14 additions & 0 deletions src/BlazorWebView/src/Maui/BlazorWebView.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Threading.Tasks;
using System.Runtime.Versioning;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.Extensions.FileProviders;
using Microsoft.Maui;
Expand All @@ -10,8 +11,21 @@ namespace Microsoft.AspNetCore.Components.WebView.Maui
/// <summary>
/// A <see cref="View"/> that can render Blazor content.
/// </summary>
#if ANDROID
[SupportedOSPlatform(AndroidSupportedOSPlatformVersion)]
#elif IOS
[SupportedOSPlatform(iOSSupportedOSPlatformVersion)]
#endif
Comment thread
jonathanpeppers marked this conversation as resolved.
public partial class BlazorWebView : View, IBlazorWebView
{
// NOTE: keep these in *reasonably* in sync with:
// * src\BlazorWebView\src\Maui\Microsoft.AspNetCore.Components.WebView.Maui.csproj
// * src\Templates\src\templates\maui-blazor\MauiApp.1.csproj
// * src\Templates\src\templates\maui-blazor-solution\MauiApp.1\MauiApp.1.csproj
// * https://learn.microsoft.com/dotnet/maui/supported-platforms
internal const string AndroidSupportedOSPlatformVersion = "android24.0";
internal const string iOSSupportedOSPlatformVersion = "ios14.0";
Comment thread
jonathanpeppers marked this conversation as resolved.
Outdated

internal static string AppHostAddress { get; } = HostAddressHelper.GetAppHostAddress();

private readonly JSComponentConfigurationStore _jSComponents = new();
Expand Down
4 changes: 3 additions & 1 deletion src/BlazorWebView/src/Maui/BlazorWebViewHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
namespace Microsoft.AspNetCore.Components.WebView.Maui
{
#if ANDROID
[SupportedOSPlatform("android23.0")]
[SupportedOSPlatform(BlazorWebView.AndroidSupportedOSPlatformVersion)]
#elif IOS
[SupportedOSPlatform(BlazorWebView.iOSSupportedOSPlatformVersion)]
Comment thread
jonathanpeppers marked this conversation as resolved.
#endif
public partial class BlazorWebViewHandler
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
<PackageTags>$(DefaultPackageTags);blazor;webview;aspnet</PackageTags>
<PackageIconFullPath>$(MauiRootDirectory)Assets\aspnet-icon.png</PackageIconFullPath>
<Description>Build .NET Multi-platform App UI (.NET MAUI) apps with Blazor web UI in the BlazorWebView control.</Description>
<!-- NOTE: keep in sync with BlazorWebView.cs -->
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">24.0</SupportedOSPlatformVersion>
Comment thread
jonathanpeppers marked this conversation as resolved.
</PropertyGroup>

<Import Project="$(MauiSrcDirectory)MultiTargeting.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public static IWindowsFormsBlazorWebViewBuilder AddWindowsFormsBlazorWebView(thi
public static IWpfBlazorWebViewBuilder AddWpfBlazorWebView(this IServiceCollection services)
#elif WEBVIEW2_MAUI
#if ANDROID
[System.Runtime.Versioning.SupportedOSPlatform("android23.0")]
[System.Runtime.Versioning.SupportedOSPlatform(BlazorWebView.AndroidSupportedOSPlatformVersion)]
#elif IOS
[System.Runtime.Versioning.SupportedOSPlatform("ios11.0")]
[System.Runtime.Versioning.SupportedOSPlatform(BlazorWebView.iOSSupportedOSPlatformVersion)]
Comment thread
jonathanpeppers marked this conversation as resolved.
#endif
public static IMauiBlazorWebViewBuilder AddMauiBlazorWebView(this IServiceCollection services)
#else
Expand Down
Loading