I am new with XCode and iOS development.
What we need to do: We need to create widget that will have button on it. This button must be clickable and when clicking on it, some action should be triggered. (For our particular case, we need to start recording form device microphone)
What we have done: We have created iOS application, added widget extension and we are able to communicate small string between main app and widget. I have searched on internet, also went trough following question: ios-add-button-to-widget-extension I have also found following topic: How to add Buttons to a Widget but i am struggling to have a clear idea.
How can i add clickable button to iOS widget?
Thanks
Full interaction functionality is now possible! This answer provides all the details: https://stackoverflow.com/a/77190038/1759443
This answer works for both Widgets and Live Activities.
This is possible, but there are some limitations.
systemSmall
widget is treated as one clickable area (no granular control over multiple touch targets)systemMedium
and systemLarge
can have more touch targets and use Link
to deeplink to your app with a specific action.To see an example of how this can be done, you can refer to this post.