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

Porting Keyboard Extension from xamarin.ios to .net8 #21119

Open
abbetch opened this issue Aug 27, 2024 · 3 comments
Open

Porting Keyboard Extension from xamarin.ios to .net8 #21119

abbetch opened this issue Aug 27, 2024 · 3 comments
Labels
app-extensions support The issue is related to support
Milestone

Comments

@abbetch
Copy link

abbetch commented Aug 27, 2024

Apple platform

iOS

Framework version

net8.0-*

Affected platform version

VS 2022 17.11.1

Description

I have a Xamarin.iOS project that include a keyboard extension. (Custom keyboard written in with xamairn.ios).

A lot of the logic / business c# code is shared with an android version, and macos version, and a windows version.

Since the end of visual studio for mac and xamarin, we've been looking to port that project, and decided to upgrade to .net8 since it was mentioned that most xamarin.ios feature were integrated in it.

My issue is that I can't see any option to create a .net8 keyboard extension in visual studio. (I've tried on a windows machine, and the soon deprecated visual stuidio for mac, even on jetbrain's rider).

Is it currently possible to do ? Even by maybe twicking the csproj by hand ? or it's currently not supported ? If that's the case, is this feature planned ?

Here is a barebone example of a keyboard extension written in xamarin.ios ( https://github.com/Francis365/CustomKeyboard )

Steps to Reproduce

  • Download the example project
  • Try to upgrade it to .net8 (or maybe 9 ?)

Did you find any workaround?

No response

Build logs

No response

@rolfbjarne
Copy link
Member

Extension projects are supported just fine, but we haven't implemented any templates yet (this is a known issue we're working on).

There's not really much magic to extension projects in .NET either, you can create an app project from a template, and I believe only two changes are required to make it an extension project:

  1. Extension projects are library projects, so remove <OutputType>Exe</OutputType> from the csproj.
  2. Add the <IsAppExtension>true</IsAppExtension> property to the csproj.

Then you can migrate everything in your Xamarin extension project to the .NET extension project as if were a normal app project.

@rolfbjarne rolfbjarne added support The issue is related to support app-extensions labels Aug 28, 2024
@rolfbjarne rolfbjarne added this to the Future milestone Aug 28, 2024
@rolfbjarne
Copy link
Member

Closing since there's nothing actionable from our side that's not already filed elsewhere.

If you have any problems porting/creating an extension project, feel free to keep asking here or opening a new issue.

@thefex
Copy link

thefex commented Sep 6, 2024

Just make sure you add

 <ProjectReference Include="..\ExtensionProject.csproj" >
      <IsAppExtension>True</IsAppExtension>
      <IsWatchExtension>False</IsWatchExtension>
    </ProjectReference>

in your Main app project - extensions are not included in .app/.ipa in my case when it's added in Extension project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app-extensions support The issue is related to support
Projects
None yet
Development

No branches or pull requests

3 participants