The solution is found.
To use buttons in LA or Dynamic Island, it shouldn’t be AppIntent, it should be LiveActivityIntent.
struct PauseIntent: LiveActivityIntent {
// followed by the rest of the code
}
either load the user defaults data that is linked with App Group or use SwiftData/CoreData, inject model container, and save the updated state there.
Then update the live activity, the LA or Dynamic Island will show the updated ContentState. When returning to the app, reload the data from the data store and rebuild the necessary view models.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: