MarLoe.MAUI.Native.Embedded 0.3.2

dotnet add package MarLoe.MAUI.Native.Embedded --version 0.3.2
                    
NuGet\Install-Package MarLoe.MAUI.Native.Embedded -Version 0.3.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MarLoe.MAUI.Native.Embedded" Version="0.3.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MarLoe.MAUI.Native.Embedded" Version="0.3.2" />
                    
Directory.Packages.props
<PackageReference Include="MarLoe.MAUI.Native.Embedded" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MarLoe.MAUI.Native.Embedded --version 0.3.2
                    
#r "nuget: MarLoe.MAUI.Native.Embedded, 0.3.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MarLoe.MAUI.Native.Embedded@0.3.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MarLoe.MAUI.Native.Embedded&version=0.3.2
                    
Install as a Cake Addin
#tool nuget:?package=MarLoe.MAUI.Native.Embedded&version=0.3.2
                    
Install as a Cake Tool

Logo MAUI.Native.Embedded

NuGet version (MarLoe.MAUI.Native.Embedded)

Embed native iOS AppClips and iOS Widgets into you MAUI app

MAUI currently does not support AppClips or Widgets for iOS. This NuGet will allow you to embed natively build AppClips & Widgets into you MAUI app.

Your native added projects will be build for you. You do not need to do anything but adding it.

iOS AppClips & iOS Widgets

In you main MAUI project (.csproj) file you can add one or more of the following line(s);

<ItemGroup>
  <AppClips Include="./Platforms/iOS/Native/Native.xcodeproj" />
  <Widgets Include="./Platforms/iOS/Native/Native.xcodeproj" />
</ItemGroup>

The Native.xcodeproj can be named anything and placed anywhere as long as it can be referenced from you MAUI project. But I suggest putting it under Platforms/iOS.

Scheme (optional)

Normally in Xcode projects, the main scheme is named the same as the Xcode project file (.xcodeproj) file. Should this not be the case, it is possible to specify the exact scheme to use.

When building your embedded Xcode project the scheme used will be the same name as the Xcode project (.xcodeproj) filename. In the example above, the scheme used if not specified will be Native

You can override scheme like this:

<ItemGroup>
  <AppClips Include="./Platforms/iOS/Native/Native.xcodeproj" Scheme="AnotherScheme" />
  <Widgets Include="./Platforms/iOS/Native/Native.xcodeproj" Scheme="ThirdScheme" />
</ItemGroup>

Configuration (optional)

Normally in Xcode projects, the configurations are called Debug and Release. This usually corresponds to the configurations used in .NET and MAUI projects.

When building your embedded Xcode project the configuration names from your MAUI project will be used.

You can override configuration like this:

<ItemGroup>
  <AppClips Include="./Platforms/iOS/Native/Native.xcodeproj" Configuration="AnotherConfiguration" />
  <Widgets Include="./Platforms/iOS/Native/Native.xcodeproj" Configuration="AnotherConfiguration" />
</ItemGroup>

If the configuration names does not match, you can e.g. do this (works for both <AppClips> and <Widgets>)

<ItemGroup>
  <AppClips 
    Condition="'$(Configuration)' == 'Debug'"
    Include="./Platforms/iOS/Native/Native.xcodeproj"
    Configuration="NativeDebug" />

  <AppClips 
    Condition="'$(Configuration)' == 'Release'"
    Include="./Platforms/iOS/Native/Native.xcodeproj"
    Configuration="NativeRelease" />
</ItemGroup>

SkipValidation (optional)

For AppClips the application identifier and the com.apple.developer.parent-application-identifiers in the AppClips entitlement must match the ApplicationId of the MAUI app.

After the MAUI app has been build, it is verified that there is a match. If not the build will fail with an error 1013 (I had to chose a number 😉. The validation process relies on a couple of command line tools to be present on the build system. If not, the validation and thus the build will fail.

You can skip validation like this:

<ItemGroup>
  <AppClips Include="./Platforms/iOS/Native/Native.xcodeproj" SkipValidation="true" />
</ItemGroup>

NoSigning (optional)

Especially for CI builds, it can be difficult to get provisionings working. In order to mitigate this, you can skip signing of the Xcode project. I also am skipping signing in the sample app in order for it to build straight out of the box.

You can skip signing like this:

<ItemGroup>
  <AppClips Include="./Platforms/iOS/Native/Native.xcodeproj" NoSigning="true" />
  <Widgets Include="./Platforms/iOS/Native/Native.xcodeproj" NoSigning="true" />
</ItemGroup>

Hints

Here are a few hints that might make your life easier.

Hint: Only add for release builds

When e.g. adding AppClips, you might want to only build and embed the native project when making release builds. Do this by adding a condtion:

<ItemGroup>
  <AppClips Condition="'$(Configuration)' == 'Release'" Include="./Platforms/iOS/Native/Native.xcodeproj" />
</ItemGroup>

Hint: Custom Xcode project version

If your Xcode project uses a custom way of storing versions, you can make an custom update here.

All you need to do is to add this target to your project (.csproj)

<Target Name="CustomXcodeUpdateVersion" AfterTargets="_UpdateXcodeProjectsVersion">
  
</Target>

Hint: Parse command line parameters to Xcodebuild

If you need to parse extra command line parameters to the xcrun xcodebuild archive ... you can use the XcodeParams attribute.

  <AppClips Include="./Platforms/iOS/Native/Native.xcodeproj" XcodeParams="ENABLE_BITCODE=NO SKIP_INSTALL=NO"/>

Hint: Testing the Xcodebuild

If you need to test and verify that the Xcode build part works, you can build these targets: BuildAppClips, BuildWidgets or BuildNativeEmbedded (to build all). This targets only the Xcode build step and avoids waiting for the entire MAUI project to build.

dotnet build -f:net9.0-ios -t:BuildAppClips,BuildWidgets MAUI.Native.Embedded.Sample/MAUI.Native.Embedded.Sample.csproj

TLDR;

Support AppClip or Widget for iOS in your MAUI project by adding this to your project (.csproj) file:

<ItemGroup>
  <AppClips Include="./Platforms/iOS/Native/Native.xcodeproj" />
  <Widgets Include="./Platforms/iOS/Native/Native.xcodeproj" />
</ItemGroup>

Disclaimer

Embedding native elements into MAUI might look easy with this nuget. But please note that this nuget only puts the native part in the MAUI app. Making C# talk to Swift/SwiftUI/Objective-C is not that easy.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.2 27 8/31/2025
0.3.1 198 8/26/2025
0.2.2 128 8/18/2025
0.2.1 133 8/13/2025
0.1.6 112 7/31/2025
0.1.5 114 7/31/2025
0.1.4 115 7/29/2025
0.1.3 114 7/28/2025