Launch App with Siri on a locked device

We are looking at the possibility of launching our app through Siri with a locked device. We have the device responding to our App Intent but it is asking to be unlocked first. If the device is locked the intent works perfectly. It just doesn't seem to respect the set intentAuthenticationPolicy. Thank you for you time looking into this.

We have set these var to .alwaysAllowed and open to true.

static var authenticationPolicy: IntentAuthenticationPolicy = .alwaysAllowed
static var openAppWhenRun: Bool = true

Here is our full test code:

import AppIntents
import SwiftUI
// MARK: - App Intents
struct OpenAppIntent: AppIntent {
static var title: LocalizedStringResource = "Open Main App"
static var description: IntentDescription? = .init(stringLiteral: "Opens the App")
static var authenticationPolicy: IntentAuthenticationPolicy = .alwaysAllowed
static var openAppWhenRun: Bool = true
func perform() async throws -> some IntentResult {
print("App opened")
return .result()
}
}
struct TestAppShortcutProvider: AppShortcutsProvider {
static var appShortcuts: [AppShortcut] {
AppShortcut(
intent: OpenAppIntent(),
phrases: [
"Begin \(.applicationName)"
],
shortTitle: "Open App",
systemImageName: "popcorn.fill"
)
}
}

openAppWhenRun requires the customer to unlock the device, because the app is being brought to the foreground. A foreground launch of an app implies that it has full access to system resources and the normal environment that an app runs in if launched from their Home screen, including access to data protected by the system according to the device lock status.

Think of the authentication policy more for intents that can run in the background without needing the full app in the foreground to achieve the task. For something like checking the weather quickly, that information is public so there isn't a need for someone to authenticate with the device first, but for something more private like checking what's on a calendar for the day, an app may only want to provide that information after ensuring the device is authenticated first.

— Ed Ford,  DTS Engineer

Launch App with Siri on a locked device
 
 
Q