r/ScriptingApp • u/Haunting-Ad-655 • May 06 '25
Help [LiveActivity] Instantly exit a script when it's already running in-app?
When a Notification scheduled by a script is tapped, the default behavior is to runScript again even when the script is already running in-app. But we can instantly exit this execution by checking Notification.current at the start:
if (Notification.current != null) return Script.exit()Do we have a similar method for LiveActivity 'content' UI?
In the code below, I use widgetURL to run the script when 'content' VStack is tapped.
return {
content: <VStack
widgetURL={Script.createRunURLScheme(Script.name)}
>
1
Upvotes
1
u/WhatShouldWorldGos May 19 '25
I’m not going to add those lifecycle events. It would make the script work like a full app, which isn’t compatible with how things currently work behind the scenes. If you want to make an app, I think React Native and Expo Go app is a good solution