I've created a barebones Multiplatform app and added an App Intent and App Shortcut. When running on iOS, I can see my app show up in Shortcuts and use the intent or App Shortcut as normal. On macOS, my app does not appear in the Shortcuts app, neither the App Shortcut nor the intent.
Is there additional configuration required to enable Shortcuts / App Intents on macOS?
This is the only code I've added to a brand-new Xcode Multiplatform project:
import AppIntents
struct OpenIntent: AppIntent {
static let title: LocalizedStringResource = "Open MacShortcut"
static let description: LocalizedStringResource = "Opens the app"
/// Launch your app when the system triggers this intent.
static let openAppWhenRun: Bool = true
/// Define the method that the system calls when it triggers this event.
@MainActor
func perform() async throws -> some IntentResult {
/// Return an empty result since we're opening the app
return .result()
}
}
struct MacShortcutShortcutsProvider: AppShortcutsProvider {
static var appShortcuts: [AppShortcut] {
AppShortcut(
intent: OpenIntent(),
phrases: [
"Open a session of \(.applicationName)"
],
shortTitle: "Open",
systemImageName: "arrow.up.circle.fill"
)
}
}