ios start live activity from share extension

38 views Asked by At

I have a share extension that receives text shared by the user. I now want to create a live activity from the share activity to show the shared text in the dynamic island. Here is the function is call:

func startLiveActivity() {
 
        let attr = LiveAttributes(title: "MyApp")
        let initialState = LiveAttributes.Content(currentItem: "current", allItems: "all")
            do {
                self.activity = try Activity<LiveAttributes>.request(attributes: attr, contentState: initialState)
            } catch {
                print(error.localizedDescription)
            }

}

I get the following error

Target does not include NSSupportsLiveActivities plist

The option "Supports Live Activity" is enabled in plist of my Share Extension
enter image description here

I it not possible to start dynamic island from share extension? Is there a workaround to first open my app, open the dynamic island and then close it again?

0

There are 0 answers