Open aritchie opened 8 months ago
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.
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.
Adding a relevant link to the topic on how to do this, there is also this discussion on the topic as well https://github.com/dotnet/maui/discussions/1144
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.
@liejuntao001 I have successfully added an app this way and used WCSession to send Data from the phone to the App. Althoiugh you probably figured out the issue already
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: https://github.com/xamarin/xamarin-macios/issues/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
--
See https://github.com/xamarin/xamarin-macios/issues/16417.