Skip to content

Commit

Permalink
Added Mac Catalyst project to sample.
Browse files Browse the repository at this point in the history
  • Loading branch information
FabriBertani committed May 6, 2023
1 parent fc99890 commit f9aee25
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 1 deletion.
6 changes: 5 additions & 1 deletion samples/AppRatingSample/AppRatingSample.csproj
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0-android;net7.0-ios</TargetFrameworks>
<TargetFrameworks>net7.0-android;net7.0-ios;net7.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
Expand Down Expand Up @@ -61,6 +61,10 @@
<ProjectReference Include="..\..\Plugin.Maui.AppRating\Plugin.Maui.AppRating.csproj" />
</ItemGroup>

<ItemGroup>
<None Remove="Platforms\MacCatalyst\" />
</ItemGroup>

<!--<ItemGroup>
<MauiXaml Update="Platforms\Windows\App.xaml">
<Generator>MSBuild:Compile</Generator>
Expand Down
9 changes: 9 additions & 0 deletions samples/AppRatingSample/Platforms/MacCatalyst/AppDelegate.cs
@@ -0,0 +1,9 @@
using Foundation;

namespace AppRatingSample;

[Register(nameof(AppDelegate))]
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
30 changes: 30 additions & 0 deletions samples/AppRatingSample/Platforms/MacCatalyst/Info.plist
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/appicon.appiconset</string>
</dict>
</plist>
14 changes: 14 additions & 0 deletions samples/AppRatingSample/Platforms/MacCatalyst/Program.cs
@@ -0,0 +1,14 @@
using UIKit;

namespace AppRatingSample;

public class Program
{
// This is the main entry point of the application.
static void Main(string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main(args, null, typeof(AppDelegate));
}
}

0 comments on commit f9aee25

Please sign in to comment.