I'm using the AppIntents framework introduced in iOS 16. My goal is to create an AppIntent that performs a long-running task but does open my app when run. When I run the Intent from the Shortcuts app, I see an error message that says the shortcut "was interrupted because it didn't finish executing in time." Is there a way to signal progress to the user of a long-running AppIntent or get more time from the system prior to the AppIntent being cancelled?
AppIntent with long-running perform()
I also got the same error message.
Im working with a potentially long running perform() function as well. In my case there is a streaming data operation that gets triggered when the AppIntent starts. It may be quick, or it may take quite some time.
What I have found is that we can extend the operation of the perform() method by periodically updating the user with the data that has been received so far and asking them if they want to continue.
dialogRespone = partialDataRecived + " --- There is more. Would you like to continue?"
try await requestConfirmation(result: .result(dialog: "\(dialogResponse)"))
I have that in a loop that waits a conservative 15 seconds, which in practice seems to be below the time threshold we have seen Siri/Shortcuts timeout the perform(). Its also monitoring a flag that indicates when the data is completely received and proceeds when either the timer or data is complete.