Post

Replies

Boosts

Views

Activity

Appintent: openAppWhenRun breaks shortcut when phone is locked
I have an app intent like the one below. If the intent is run via siri when the phone is locked then the user is asked to unlock their phone but the shortcut is interrupted. Is it possible to delay opening the app until the result dialog is returned? import AppIntents struct MyIntent: AppIntent { static var title: LocalizedStringResource = "MyApp" static var description = IntentDescription("Captures data") static var openAppWhenRun: Bool = true @Parameter(title: "The Data") var theData: String @MainActor func perform() async throws -> some IntentResult { _ = try await RESTClient.postData(theData: theData) return .result(dialog:"Thank you!") //TODO: Now try to open app } }
0
0
599
Jun ’23
App Intents authentication best practice
I'm using the App Intents framework to create a shortcut that captures data from a user and posts it to a web service. Is there any documentation or advice about the best way to handle the authentications tokens that the web service requires? I need the user to register via an app and get a user ID, access token and refresh token from the service, then pass that to the shortcut somehow so that they can post data. Any guidance about the best way to do this would be amazing.
0
0
268
Apr ’23