Dive into App Intents

RSS for tag

Discuss the WWDC22 Session Dive into App Intents

Posts under wwdc2022-10032 tag

6 Posts
Sort by:
Post not yet marked as solved
0 Replies
40 Views
I am creating new intenta with the new framework. So far is working fine. But the dialog is only show in preview. How can I make Siri to read at loud the text in Dialog? thanks a lot in advance
Posted
by lui.
Last updated
.
Post marked as solved
2 Replies
169 Views
I'm implementing the iOS 16 AppIntents framework and it works fine except when I try to trigger it with Siri, which just pulls up results from the web. Here's a very simple version I made on an empty project. import Foundation import AppIntents @available(iOS 16.0, *) struct ShowMeBooks: AppIntent {     static var openAppWhenRun: Bool = false     static var title: LocalizedStringResource = "Show me my books"          func perform() async throws -> some IntentPerformResult {         let x = 1 + 1         return .finished(dialog: "Here are your books")     } } @available(iOS 16.0, *) struct SouthwestShortcuts: AppShortcutsProvider {     static var appShortcuts: [AppShortcut] {         AppShortcut(             intent: ShowMeBooks(),             phrases: ["Show me my books on \(.applicationName)"]         )     } }
Posted
by F99.
Last updated
.
Post not yet marked as solved
1 Replies
94 Views
Is it possible to put a pause in Siri's responses to an AppIntent? in the code below id like Siri to pause a bit longer than she does between sentence one and sentence two. i've tried using "..." and multiple "." similar to what she does when she's responding to "how is the market" if you ask a HomePod - she pauses a bit longer between her comments on each market, a bit more than an end of sentence - more like the pause between each point when you are going through a list of bullet points - which is really what i'm using this for. Also is it possible to hide all or part of of the dialog text displayed? so she says it but doesn't show it. I've got a view which shows a better formatted representation of what she says than the text itself. struct TestAppIntent: AppIntent {     static var title: LocalizedStringResource = "A question?"     static var openAppWhenRun: Bool = false     @MainActor     func perform() async throws -> some IntentResult {         return .result(             dialog: "sentence one. sentence two", view: someView()         )     } }
Posted
by ngb.
Last updated
.
Post marked as solved
2 Replies
380 Views
Hi, We are trying to add our application shortcuts using below code but it's not getting reflected in Shortcuts App and so Siri feature is not working for our app. We followed the same approach mentioned in WWDC 2022 session. Kindly suggest the fix. struct StartMeditationIntent: AppIntent {     static let title: LocalizedStringResource = "Start Meditation Session"     func perform() async throws -> some IntentPerformResult {         let answer: LocalizedStringResource = "Session Started"         let dialogIntent  = IntentDialog(answer)         return .finished(dialog: dialogIntent)     } } struct LibraryAutoShortCuts: AppShortcutsProvider {     static var appShortcuts: [AppShortcut] {         AppShortcut(intent: StartMeditationIntent(), phrases: ["Start Meditation"])     } }
Posted Last updated
.
Post not yet marked as solved
0 Replies
138 Views
I have set Xcode preference Command line Tools to Xcode14.0, but is not work, so What's wrong with me?Environment configuration or certificate authority ? This is My Code : import Foundation import SwiftUI import AppIntents struct ShowMyProgressIntent: AppIntent { static var title: LocalizedStringResource = "Show Sport Progress" @MainActor func perform() async throws -> some IntentPerformResult { return .finished { ProgressView() } } } struct StartSportActivityIntent: AppIntent { static var title: LocalizedStringResource = "Start Sport Activity" static var openAppWhenRun: Bool = true // Open app directly @Parameter(title: "Activity") var activity: SportActivity @MainActor func perform() async throws -> some IntentPerformResult { let model = SportActivityModel(type: activity) ViewModel.shared.navigateTo(model: model) return .finished(value: true) } } struct SportLogShortcuts: AppShortcutsProvider { static var appShortcuts: [AppShortcut] { AppShortcut( intent: ShowMyProgressIntent(), phrases: [ "Show My Progress in (.applicationName)", "Start running now" ] ) } }
Posted Last updated
.
Post not yet marked as solved
2 Replies
281 Views
Made a separate target for App Intents, but I don't get it to work. The intent is shown in the Shortcuts app when registered using AppShortcutsProvider. But upon running the intent it gives this error: Error Domain=LNActionFor- AutoShortcutPhraseFetchError Code=1 "No AutoShortcuts instance registered." UserInfo={NSLocalizedDescription=No AutoShortcuts instance registered.} I've attached a sample project to my FA-post FB10199299
Posted
by JagCesar.
Last updated
.