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

Attaching a native watchOS app to a .NET 8 app #20317

Open
aritchie opened this issue Mar 15, 2024 · 4 comments
Open

Attaching a native watchOS app to a .NET 8 app #20317

aritchie opened this issue Mar 15, 2024 · 4 comments
Labels
feature A feature to be implemented watchOS
Projects
Milestone

Comments

@aritchie
Copy link

With watchOS being officially removed since .NET 6, we now have to do native watchOS apps (not an issue).

There is still the ability to create app extensions and those work fine, but how do I link in a native watchOS app?

I've looked through Microsoft docs without any luck. I've found this issue: #10070 and from that an example app: https://github.com/vouksh/MauiWithWatchApps

Is there something more "official" in terms of how to accomplish this?

@dalexsoto

@rolfbjarne
Copy link
Member

Is there something more "official" in terms of how to accomplish this?

No, at the moment there's no official way to add a native watchOS app to a .NET project.

We should figure out a way though; the example app you linked to seem to work by accident because we haven't removed the build logic to support watchOS apps yet (this is because most of the build code is shared between Xamarin.iOS and .NET, once we drop support for Xamarin.iOS we'll eventually want to remove non-.NET code).

In any case you can use the method the sample app uses, we'll keep making that work until we implement a supported way of doing it.

@rolfbjarne rolfbjarne added this to the .NET 9 milestone Mar 18, 2024
@rolfbjarne rolfbjarne added watchOS feature A feature to be implemented labels Mar 18, 2024
@rolfbjarne rolfbjarne added this to Other in .NET 9 Mar 18, 2024
@rolfbjarne
Copy link
Member

I'm tentatively marking this for .NET 9, but it's likely it won't get done until later. IMHO this would make sense to implement when we remove watchOS logic in our code base, which we probably won't do until after .NET 9.

@beeradmoore
Copy link

Adding a relevant link to the topic on how to do this, there is also this discussion on the topic as well dotnet/maui#1144

@liejuntao001
Copy link

liejuntao001 commented May 20, 2024

Thanks for the demo project MauiWithWatchApps
I tried it and it does bundle the native Watch app into the dotnet iOS app, but that's it.
The watch app does not install automatically.
I could manually install it from the Watch app, but the 2 apps (on watch and on iphone) don't talk to each other. The WCSession never bomes Reachable.
Is it just me or same for others?
Any suggestion to improve?

Never mind. I figured out I have to add one line to the demo native watch app to initilate the WCSession.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A feature to be implemented watchOS
Projects
.NET 9
Other
Development

No branches or pull requests

4 participants