xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.44k stars 508 forks source link

[Xcode 12] WidgetKit reloadTimelines API is Swift only but really needs to be callable from C# host app #9215

Open chamons opened 4 years ago

chamons commented 4 years ago

As noted here the WidgetKit APIs are Swift only, which will make reloadTimelines not bindable without special measures.

This will make interacting with Widgets written in Swift extra painful, as you won't be able to request data reloads.

chamons commented 4 years ago

One approach that Rolf came up with off the top of his head to consider is:

Extending our build to build swift on all platforms may be a tad tricky, but doable.

wojciech-kulik commented 3 years ago

+1 missing reloadTimelines will make new widgets implementation really annoying.

t9mike commented 3 years ago

See https://stackoverflow.com/questions/64185669/how-to-access-widgetcenter-from-widgetkit-in-xamarin-ios for work arounds.

wojciech-kulik commented 3 years ago

@t9mike I'm not sure if you noticed but this question on StackOverflow was created by me 😂 Btw. I've already implemented and published new version with widgets (and Apple Watch app manually added to xcarchive) ;) Here is the result: https://wojciechkulik.pl/smog-polska

t9mike commented 3 years ago

Oh I know! But just in case someone stumbles upon this issue but not the SO question. Thanks so much for your paving the way. Your app looks slick!

I have finally got to the point with my project that I have completed porting my core engine to Swift, created widgets, and new Apple Watch app (dumping old C# version).

uwe-neuronation commented 2 years ago

no updates here? Any plans to support that?

mnxamdev commented 2 years ago

This is still very much needed, thanks!

JeroenBer commented 2 years ago

Any updates ? Still very needed, thanks!

chamons commented 2 years ago

While not a full solution to the general problem, the prototype in https://github.com/xamarin/xamarin-macios/issues/15315 can solve this specific problem, and I have a full sample which uses it.

Check it out!