Posts

Post not yet marked as solved
0 Replies
822 Views
I am currently exploring LiveActivity by adding widget extension to the app. It works fine and I can see the widget in the lock screen and dynamic island. I can create, update or end the activity properly. However I want to explore it further, can this LiveActivity widget be built as a package or framework? I have tested the following: First, I am thinking of using Swift Package Manager, however since widget extension requires adding the target widget extension to a project, I can't see how this is being done using SPM. There is no option to add widget extension to a package.  For Swift Package Manager - Target is disabled. Second, I tried to create a framework. This allows me to add new target to the framework project and select Widget extension. I was able to set the Widget attributes, ContentState and create the ActivityConfiguration for LiveActivity. The problem is when creating the views for either lock screen view or dynamic islands, the views are not shown on the screen. I know that the activity was created successfully. This is proven by tapping on the dynamic island, it opens the app. It is just no view (leading or trailing or expanded or lockScreen view) is being shown. So I am wondering if it is even possible to create this widget for LiveActivity as a framework/xcframework.  If this is not even possible, then adding the code to the main app might be the only solution. Appreciate any insights.
Posted
by asetiyadi.
Last updated
.