Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS service extensions #1434

Open
davidbritch opened this issue Apr 17, 2023 · 2 comments
Open

iOS service extensions #1434

davidbritch opened this issue Apr 17, 2023 · 2 comments
Labels
doc-idea Indicates issues that are suggestions for new topics [org] Pri3

Comments

@davidbritch
Copy link
Contributor

davidbritch commented Apr 17, 2023

Add content on how to add an iOS service extension to a MAUI project. This is supported, but there's no project template for it. Instead, it'll require re-using the project file created by the Xamarin.iOS template and porting it to MAUI.

dotnet/maui#8299
dotnet/maui#3289

https://learn.microsoft.com/en-us/xamarin/ios/platform/extensions
https://learn.microsoft.com/en-us/xamarin/ios/platform/extensions-with-xamarinforms

Update April 2023: While it's possible to get this working, iOS extensions have so many rough edges in .NET 6/7 that I'll hold off doc'ing this until some work's been performed in this area.

This item will add the templates: xamarin/xamarin-macios#16127

@dotnet-bot dotnet-bot added the ⌚ Not Triaged Not triaged label Apr 17, 2023
@davidbritch davidbritch added doc-idea Indicates issues that are suggestions for new topics [org] and removed ⌚ Not Triaged Not triaged labels Apr 17, 2023
@vikher
Copy link

vikher commented Jan 5, 2024

Is there any guidance available on creating an IPA build locally using the dotnet publish command? Specifically, considering that the iOS extension might require its own provisioning profile, how can the command address this limitation as it seems to allow only one provisioning profile with parameters: dotnet publish -f $(iOSVersion) -c $(BuildConfiguration) /p:ArchiveOnBuild=true /p:RuntimeIdentifier=ios-arm64 /p:EnableAssemblyILStripping=false /p:CodesignKey=$(CodesignKey) /p:CodesignProvision=$(CodesignProvision)

@skuzminov-softheme
Copy link

@vikher Try to set build properties in the csproj file and let msbuild resolve it on the pipeline automatically:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFrameworks>net8.0-ios</TargetFrameworks>
    <UseMaui>true</UseMaui>
    <OutputType>Library</OutputType>
    <Nullable>disable</Nullable>
    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
    <ImplicitUsings>enable</ImplicitUsings>
    <PlatformTarget>ARM64</PlatformTarget>
    <MtouchDevice>iPhone</MtouchDevice>
    <RuntimeIdentifier>ios-arm64</RuntimeIdentifier>
    <ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
    <ApplicationVersion>1</ApplicationVersion>
    <CodesignProvision>Automatic</CodesignProvision>
    <CodesignKey>iPhone Distribution</CodesignKey>
    <CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
    <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
  </PropertyGroup>

  <PropertyGroup>
    <IsAppExtension>True</IsAppExtension>
    <IsWatchExtension>False</IsWatchExtension>
  </PropertyGroup>
</Project>

and in yaml:

    - task: CmdLine@2
      displayName: 'Build iOS App'
      inputs:
        script: >
          dotnet publish {ProjectName}.csproj -f "net8.0-ios" -c Release -v n
          /p:ArchiveOnBuild=true 

Of course, the app and extension profiles should be installed before archiving.
If you get ditto.exe error - try to build extension app before main project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-idea Indicates issues that are suggestions for new topics [org] Pri3
Projects
None yet
Development

No branches or pull requests

4 participants