Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net9.0-android;net9.0-ios</TargetFrameworks>
<TargetFrameworks>net10.0-android;net10.0-ios</TargetFrameworks>

<OutputType>Exe</OutputType>
<RootNamespace>MAUI.Native.Embedded.Sample</RootNamespace>
Expand Down
3 changes: 1 addition & 2 deletions MAUI.Native.Embedded.Sample/Platforms/iOS/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using ObjCRuntime;
using UIKit;
using UIKit;

namespace MAUI.Native.Embedded.Sample;

Expand Down
4 changes: 2 additions & 2 deletions MAUI.Native.Embedded.nuget/MAUI.Native.Embedded.nuget.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0</TargetFrameworks>
<TargetFrameworks>net10.0;net9.0;net8.0;net7.0;net6.0</TargetFrameworks>
<AssemblyName>MAUI.Native.Embedded</AssemblyName>
<OutputType>Library</OutputType>
<Nullable>enable</Nullable>
Expand All @@ -25,13 +25,13 @@
<NeutralLanguage>en-US</NeutralLanguage>
<License>MIT License</License>
<PackageIcon>assets/icon.png</PackageIcon>
<PackageTags>MSBuild dotnet maui xcode native embedded ios appclip widget</PackageTags>
<PackageProjectUrl>https://github.com/MarLoe/MAUI.Native.Embedded</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/MarLoe/MAUI.Native.Embedded</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<PackageTags>MSBuild dotnet maui xcode native embedded ios appclip widget</PackageTags>
</PropertyGroup>

<ItemGroup>
Expand Down
22 changes: 11 additions & 11 deletions MAUI.Native.Embedded.nuget/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ You must make sure that the Xcode projects have the correct provisioning profile

## iOS AppClips & iOS Widgets
In you main MAUI project (`.csproj`) file you can add one or more of the following line(s);
```
```xml
<ItemGroup>
<AppClips Include="./Platforms/iOS/Native/Native.xcodeproj" />
<Widgets Include="./Platforms/iOS/Native/Native.xcodeproj" />
Expand All @@ -21,7 +21,7 @@ Normally in Xcode projects, the main scheme is named the same as the Xcode proje
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:
```
```xml
<ItemGroup>
<AppClips Include="./Platforms/iOS/Native/Native.xcodeproj" Scheme="AnotherScheme" />
<Widgets Include="./Platforms/iOS/Native/Native.xcodeproj" Scheme="ThirdScheme" />
Expand All @@ -34,15 +34,15 @@ Normally in Xcode projects, the configurations are called `Debug` and `Release`.
When building your embedded Xcode project the configuration names from your MAUI project will be used.

You can override configuration like this:
```
```xml
<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>`)
```
```xml
<ItemGroup>
<AppClips
Condition="'$(Configuration)' == 'Debug'"
Expand All @@ -63,7 +63,7 @@ After the MAUI app has been build, it is verified that there is a match. If not
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:
```
```xml
<ItemGroup>
<AppClips Include="./Platforms/iOS/Native/Native.xcodeproj" SkipValidation="true" />
</ItemGroup>
Expand All @@ -73,7 +73,7 @@ You can skip validation like this:
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:
```
```xml
<ItemGroup>
<AppClips Include="./Platforms/iOS/Native/Native.xcodeproj" NoSigning="true" />
<Widgets Include="./Platforms/iOS/Native/Native.xcodeproj" NoSigning="true" />
Expand All @@ -85,7 +85,7 @@ 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:
```
```xml
<ItemGroup>
<AppClips Condition="'$(Configuration)' == 'Release'" Include="./Platforms/iOS/Native/Native.xcodeproj" />
</ItemGroup>
Expand All @@ -95,21 +95,21 @@ When e.g. adding AppClips, you might want to only build and embed the native pro
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`)
```
```xml
<Target Name="CustomXcodeUpdateVersion" AfterTargets="_UpdateXcodeProjectsVersion">
<!-- Do your custom version update here -->
</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.
```
```xml
<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
```bash
dotnet build -f:net10.0-ios -t:BuildAppClips,BuildWidgets MAUI.Native.Embedded.Sample/MAUI.Native.Embedded.Sample.csproj
```
Loading