79751913

Date: 2025-08-31 17:20:13
Score: 0.5
Natty:
Report link
  1. There is no better way
  2. There is not

You’ve bumped into a hard limitation of WidgetKit. According to Apple’s official documentation:

“Interactions with a toggle or button always guarantee a timeline reload.”

That means every AppIntent you attach to a widget will always trigger getTimeline() afterwards. As far as I know there is no supported way to mark an AppIntent as “side-effect only” or skip the reload. This is by design: WidgetKit treats widget controls as state-changing and therefore refreshes the timeline to ensure the widget reflects the latest state.

Alternative approaches like Link(destination:) don’t cause a timeline refresh, but they necessarily open the app — which doesn’t meet your requirement of sending analytics directly from the widget.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: EgSolo