WIP app invite: scaffold MAUI Essentials dependency in shared PostIt
Adds Microsoft.Maui.Essentials package and <UseMaui>true</UseMaui> to src/PostIt/PostIt/PostIt.csproj so the shared project can compile code that calls MAUI Essentials APIs (Microsoft.Maui.ApplicationModel.*). Also adds a draft ContactService that wraps Contacts.Default.GetAllAsync() behind a runtime platform check and permission request. WIP caveats: - The portable MAUI Essentials facade compiles on net10.0 but throws NotImplementedInReferenceAssemblyException at runtime when no platform-specific MAUI Essentials binary is loaded. A PostIt.Android project (or equivalent) must reference the Android MAUI Essentials implementation for Contacts.Default.GetAllAsync() to actually work. - On desktop (Linux/macOS/Windows) the API is unsupported by design; ContactService currently throws PlatformNotSupportedException. A desktop stub returning Array.Empty<Contact>() is the likely next step. - No tests yet. The scaffold is unverified at runtime; build passes.
This commit is contained in:
parent
1f4380c65a
commit
214056a3b1
3 changed files with 44 additions and 1 deletions
|
|
@ -3,11 +3,13 @@
|
|||
<TargetFramework>net10.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<UseMaui>true</UseMaui>
|
||||
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
||||
<AssemblyVersion>1.0.1.0</AssemblyVersion>
|
||||
<FileVersion>1.0.1.0</FileVersion>
|
||||
<InformationalVersion>1.0.1-5+Branch.main.Sha.0617fc6bda7151c70559d87177e2dcfb1b60995f</InformationalVersion>
|
||||
<Version>1.0.1-5</Version>
|
||||
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<AvaloniaResource Include="Assets\**" />
|
||||
|
|
@ -24,6 +26,7 @@
|
|||
<PackageReference Include="CommunityToolkit.Mvvm" />
|
||||
<PackageReference Include="IdentityModel.OidcClient" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
|
||||
<PackageReference Include="Microsoft.Maui.Essentials" />
|
||||
<ProjectReference Include="../../Yavsc.Abstract/Yavsc.Abstract.csproj" />
|
||||
<ProjectReference Include="../../Yavsc.Api.Client/Yavsc.Api.Client.csproj" />
|
||||
</ItemGroup>
|
||||
|
|
@ -40,4 +43,4 @@
|
|||
<ItemGroup>
|
||||
<PackageReference Include="GitVersion.MsBuild" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
|
|||
Loading…
Reference in a new issue