Search code examples
iosxcodeswiftui

How to create a button in live activity?How can not allow open app when click this button?


How to create a button in live activity?How can not allow open app when click this button?enter image description here


Solution

  • You can’t. Third-party Live Activities cannot have any interactivity.

    You can add a Link and style it like a button, but tapppng the link will always open your app.

    EDIT: The above is true for iOS 16 but not iOS 17. Please see Kyle's answer for iOS 17+.