I have a shortcut action ("Get file") that returns a file. It worked well until iOS 27.1 (with a slight glitch on iOS 18 RC: https://developer.apple.com/forums/thread/763630 ), but with iOS 27.2, I get the following error: "There was a problem running the shortcut "Get file"".
The structure is simple:
intentResponse.file = INFile(fileURL: fileURL, filename: fileName, typeIdentifier: nil)
completion(intentResponse)
returnUsing the debugger, I can tell that INFile() has returned, intentResponse.file has been set, and the issue happens in completion().
Weirdly, the other option (read the data from the file) does work (but it is limited in size):
if let urlData = try? Data(contentsOf: fileURL) {
intentResponse.file = INFile(data: urlData, filename: fileName, typeIdentifier: nil)
completion(intentResponse)
return
}What could explain the difference between INFile(fileURL: fileURL and INFile(data: ?
How can I work around this issue?
To make things worse, it works in the simulator, it works on iPads, it works with iOS 27.1 and before. It seems to only affect physical iPhones running iOS 27.2.
0
0
37