Implemented AppIntent doesn't show in Shortcuts app

I'm trying to test out the new AppIntents API that is currently on iOS16 Beta. Looking at the documentation, the implementation seems pretty straight forward, but after implementing it, I'm not seeing my AppIntent in the Shortcuts app. The device is running iOS 16.0.

This is how I implemented the AppIntent:

import AppIntents

struct DoSomethingIntent: AppIntent {
    
    static var title: LocalizedStringResource = "This will do something"
    
    static var description = IntentDescription("Does something")
    
    func perform() async throws -> some PerformResult {
        return .finished(value: "Done")
    }
}

According to the documentation the Shortcuts app should be able to find my AppIntent after my app gets installed, but I see that's not the case. Does anybody know what my implementation is missing or have I misunderstood the whole thing?

Post not yet marked as solved Up vote post of Norik Down vote post of Norik
384 views

Replies

I had the same issue. I could fix it by setting the Xcode-select to the Xcode-beta version. Now for me all the AppIntents appear in the shortcuts app. When you want to create an AppShortcut, you should omit custom AppEntity based parameters from the phrases. Otherwise, they don't appear in the shortcuts app and are not usable by Siri. This is likely a bug and I already filed feedback for it.

Hi I also had the same issue. You can also try by setting Command Line Tool to Xcode 14.0 (Xcode->Preference->Locations->Command Line Tools.). Also implement AppShortcutsProvider protocol. It worked for me.

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

    }
}