@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
@matthewcassinelli @matt1corey @brandonhorst Oh wait it looks like maybe this is what I want, for iOS 18 anyway
https://developer.apple.com/documentation/appintents/openurlintent
@brandonhorst @matthewcassinelli @matt1corey This leads me to believe otherwise…?
https://developer.apple.com/documentation/appintents/openurlintent#Overview
@caseyliss don't you already have 2-12 or so Rasberry Pis hosting various things out of your house? I know there's a scale difference between 4 people hitting a PiHole versus a few thousand reading an associated domains file, but technically speaking not that different of a problem to solve.
@caseyliss @matthewcassinelli @brandonhorst For sure - my website is hosted on SquareSpace, but to enable UniversalLinks, I had to jump through hoops to get the apple-app-site-association file hosted through S3 on Amazon.
So I guess I'm technically still not running a web server to do this? 🤣
(I have a terribly written and unpublished blog post I can share for this, if it applies)
@matt1corey @matthewcassinelli I just finished finally properly implementing universal links 😅 it was a wild ride
Haha typos 😅
@caseyliss @matt1corey @matthewcassinelli @brandonhorst
This seems... reasonably straightforward https://medium.com/@ales.musto/using-aws-to-host-universal-links-for-ios-b887a87a4c3b
@colin @caseyliss @matthewcassinelli @brandonhorst This is basically it, but on a quick scan, it looks like the website itself is hosted from the S3 bucket.
I didn't want to host my own website, or have to completely redesign and build it - I was already in SquareSpace. For me, only the aasa file is hosted from S3, and CloudFront routes traffic between S3 or SquareSpace, depending on the URL.
@jayfm @brandonhorst @matthewcassinelli @matt1corey how did I not see that 🤦🏻♂️
Will try that; thank you!
@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
@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 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
@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
@matt1corey Also, unrelated: the API surface for `EntitlementCheck.isEntitled(with:)`
🤩
@caseyliss @matthewcassinelli @brandonhorst @matt1corey @harshil shared a workaround that is working for us:
1. Make an OpenIntent (not OpenURLIntent) and a ”DeepLink" AppEnum target. Make the OpenIntent use the DeepLink enum as the `target`.
2. On the DeepLink enum, make a property that returns the app URL for each case.
3. In the intent’s perform(), get the URL from `target` and set it to a user default.
4. In the app UI, check for this user default in an onAppear and handle the routing.
@ryanashcraft @matthewcassinelli @brandonhorst @matt1corey @harshil I love/hate this.
🍻
@ryanashcraft @matthewcassinelli @brandonhorst @matt1corey @harshil Granted, neither of these buttons actually do the thing they're claiming to, but, uh, progress! 🎉 🤪
Thanks, everyone! 💙