Is there a way to reload iOS widget from kotlin na...
# multiplatform
i
Is there a way to reload iOS widget from kotlin native code?
m
If you can do it in Objective-C, you should be able to do it in Kotlin native inside a iOS source set.
i
Yeah I'm not seeing the Api to do so
m
Did you find the API you would use to do it in a non KMP app. It should be the same API. I would be surprised if it was a Swift only option, but it could be. If it is then you need to create a wrapper API around it that exposes Objective-C bindings.
i
WidgetCenter.shared.reloadAllTimelines()
This is how it's done in swift but I'm not seeing it in kotlin native
That's why I wanted to see if I was maybe looking in the wrong place because sometimes the names are different
m
Looks like they didn't provide an Objective-C interface to the widgets. So the options are to create your own Objective-C wrapper around it or using dependency inversion and have the main app pass in a function or interface to do it.
👍🏽 1
i
Alright thank you for getting back to me!
f