What API controls these quick links?
Spotlight your app with App Shortcuts - WWDC23 - Videos - Apple Developer

Discover how to use App Shortcuts to surface frequently used features from your app in Spotlight or through Siri. Find out how to...

Apple Developer
@brandonhorst @caseyliss I don't know - my app uses AppShortcuts, but it doesn't look like Amazon’s. When looking at this view, it seems like they have a single 'Open Amazon' OpenIntent, with different parameters applied, and somehow stylized.

@matt1corey @brandonhorst @caseyliss It is App Shortcuts, and they've taken the Open action & made parameterized instances of it with App Shortcuts.

This is a combination of parameterized phrases from the first year of App Shortcuts & the Spotlight integration from the second year.

Here's where they start to talk about it: https://developer.apple.com/wwdc22/10170?time=851 Then the rest is in Brandon's linked video.

You can also use Suggested Entities to show nicely-designed entities in Spotlight as well

Implement App Shortcuts with App Intents - WWDC22 - Videos - Apple Developer

Discover how you can create Shortcuts in your app with zero user setup. We'll show you how App Intents can help you present custom...

Apple Developer
@matthewcassinelli @matt1corey @brandonhorst Granted I've only been looking at this for ten minutes, but I'm having trouble figuring out how to write an Intent that basically just deep-links into the app…? I just watched that section of the video — thank you! — but I don't think I'm grokking how to just open the app.
OpenURLIntent | Apple Developer Documentation

An app intent that opens a universal link.

Apple Developer Documentation
@caseyliss @matthewcassinelli @matt1corey Haha looks like you beat me by 6 seconds.
@brandonhorst @matthewcassinelli @matt1corey Although that looks like it requires a web endpoint, which Callsheet doesn't have 😩
@caseyliss @brandonhorst @matt1corey This part of another of the latest videos walks though the basics of an Open Intent, but I'm assuming it's not what you want because you're trying to make a quicker version using the URL scheme instead, right? https://developer.apple.com/wwdc24/10210?time=592
Bring your app’s core features to users with App Intents - WWDC24 - Videos - Apple Developer

Learn the principles of the App Intents framework, like intents, entities, and queries, and how you can harness them to expose your app's...

Apple Developer
@matthewcassinelli @brandonhorst @matt1corey For some cases, this may work as well. But annoyingly, most of what I want to do with Intents is already defined as custom callsheet:// URLs, yeah.

@caseyliss @matthewcassinelli @brandonhorst For most of my OpenIntents, I have the deep link logic directly in the Intent code - this is an example of an OpenIntent that opens a Ledger in Bills to Budget, and navigates to a specified screen, but it can also be done with an AppIntent that has ‘openAppWhenRun' set to true.

It is a parameterized AppIntent -- it still doesn't look anything like the fancy Amazon shortcut, though

@matt1corey @caseyliss @brandonhorst Did you apply the newer bits from the Spotlight video? That's separate from parameterization.

@matthewcassinelli @caseyliss @brandonhorst Got it! At least for one of my intents. Here's what I had to change:

- My AppEnum needed to define the DisplayRespresentation with both the name and symbol name, instead of just the name (see screenshot)
- My OpenIntent needed to have this parameter defined as the `target`

I don't think AppShortcuts comes into play here, although I could be wrong, as I do have an AppShortcut defined for this intent (but I always have)

@matt1corey @caseyliss @brandonhorst Within the Shortcuts app that might be the case now, but to be shown in Spotlight it’s based off App Shortcuts.

Generally this requirement you identified was added alongside the App Shortcuts spotlight update because prior to that App Shortcuts were just tiles and didn’t need the symbol.

@matthewcassinelli @caseyliss @brandonhorst Nope, it _also_ needs to be an AppShortcut - my 'Open Account' Intent satisfied all of that already, but didn't have an AppShortcut assigned. Adding that caused it to render each option explicitly in the Shortcuts app.

But... um... Each intent is showing the options for _both_!? Wow, that's a wild bug…

@matt1corey @matthewcassinelli @caseyliss @brandonhorst thanks for filing! Do you have this reproducing in a sample you can share? That would allow us to triage it quickly.
@mgorbach @matthewcassinelli @caseyliss @brandonhorst Not yet (last minute rush), but I’ll see what I can put together
@matt1corey @matthewcassinelli @caseyliss @brandonhorst thank you! It would be much appreciated if you can. We tried to repo but are not seeing this issue. A link to a build with this failure happening would also help.
@matt1corey @caseyliss @matthewcassinelli @brandonhorst provide the app intent to an AppIntentsProvider structure and specify the icon you want to get the the amazon fancy stuff!

@matt1corey Is `navigator` a singleton? Where is it coming from?

(A summary is perfectly acceptable; I don't necessarily need to see code)

@caseyliss Ah, important detail -- ’navigator' here is an ObservableObject that I create at the root of my SwiftUI tree, and inject into the Environment. It drives the navigation of my root NavigationSplitView and NavigationStack’s, and has methods to show sheets and inspectors, so I can control this from anywhere.

I also add that (and other things) into my `AppDependencyManager`, so I can ‘inject' them into my AppIntents using the @.AppDependency mechanism

@matt1corey Is `Navigable` an `actor`? Because it needs to be `Sendable`, no?
@caseyliss I think I have it isolated to MainActor, since it’s all UI related
@matt1corey ooooooooooh iiiiiiinnnnnnteresting 🤔
@matt1corey @caseyliss can you share more about that AppDependency property wrapper? Is that a first-party thing I wasn’t aware of!?

@bonney @caseyliss It's the AppIntent Dependency Injection mechanism. Not particularly well documented, but basically you can shove a bunch of Sendable objects into an instance of AppDependencyManager, and then inject them into your AppIntents later.

I do the setup work in both my main App, and my Widget Target, and it lets me reuse the AppIntents, handling the injection appropriately either way.

https://developer.apple.com/documentation/appintents/appdependencymanager

AppDependencyManager | Apple Developer Documentation

An object that manages the registration and initialization of an app intent’s dependencies.

Apple Developer Documentation

@matt1corey Also, unrelated: the API surface for `EntitlementCheck.isEntitled(with:)`

🤩

@caseyliss Lol - it's fancy on the outside, but the implementation is... uglier…
@matt1corey this is 110% of the code I write. 😆