App shortcuts are not getting added inside Shortcuts App using App Intent.

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"])

    } }

Answered by bhushandhonge in 717270022

I am able to fix this issue by setting Command Line Tool to Xcode 14.0 (Xcode->Preference->Locations->Command Line Tools.)

Accepted Answer

I am able to fix this issue by setting Command Line Tool to Xcode 14.0 (Xcode->Preference->Locations->Command Line Tools.)

I did what you said ,Xcode preference command line tools set Xcode 14.0 but is not work .Where did I go wrong ? you use application extension or in -app?

App shortcuts are not getting added inside Shortcuts App using App Intent.
 
 
Q