I have a simple app intent using the AppIntents framework. here is a sample code:
i tried to run the intent as a part of shortcut through back tap from my ios device, This works fine if the device is unlocked, but if the device is in locked state, it does not work. Also i do not see iOS asking the user for passcode based on the authentication policy set in the code.
What i expected in this case is when the device is locked and user triggers the shortcut using back tap or assistive touch, iOS should ask me for passcode and then show me the intent view.
import AppIntents
struct SearchNumberIntent: AppIntent {
static var title: LocalizedStringResource = "Sample App Intent"
static var description = IntentDescription("Sample description")
**static var authenticationPolicy = IntentAuthenticationPolicy.requiresLocalDeviceAuthentication**
func perform() async throws -> some ShowsSnippetView {
return .result(
dialog: "Sample Dialog",
view: Text("Hello World")
)
}
}