Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have a widget-like entry in the Shortcuts app for my App Intents in iOS?

I refer to having the App Intents looking like these widgets inside the Shortcuts app. Is that possible or only reserved for Apple apps?

I thought it would be enough adding a shortTitle and systemImageName for the AppShortcuts returned in the AppShortcutsProvider but all I get are separate cards for each entry instead of the widget-like section.

enter image description here

like image 852
V. Morris Avatar asked Nov 01 '25 18:11

V. Morris


1 Answers

You need to create an AppShortcutProvider for you intent. Providing a short title and systemImage will provide the image

For Example

struct TaskAppShortcutProvider: AppShortcutsProvider {
    static var appShortcuts: [AppShortcut] = [
    AppShortcut(intent: MarkTaskCompleteIntent(),
                phrases: ["Complete Tasks in \(.applicationName)"],
                shortTitle: "Complete Task",
                systemImageName: "checkmark"),
    AppShortcut(intent: AddTaskIntent(), phrases: ["Add task to \(.applicationName)"], shortTitle: "Add Task", systemImageName: "plus")
    
    ]
}

like image 97
Ashli Rankin Avatar answered Nov 03 '25 10:11

Ashli Rankin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!