Should a URL be a string?

Asked on 08/04/2024

1 search

Yes, a URL can be represented as a string in the context of app intents. In the session What’s new in App Intents, it is explained that you can express your app entity, app enum, and app intents as having a URL representation. This allows Siri and shortcuts to treat them like links to specific content, enabling actions to open the URL or making them shareable.

For example, you can use an entity's identifier or any of its properties with the @property attribute as interpolations in the URL string. This is further elaborated in the same session at another timestamp, where it is shown how to use a universal link as a template and interpolate the entity's identifier into the URL string.

Relevant Sessions

  1. What’s new in App Intents
  2. What’s new in Quick Look for visionOS
  3. What’s new in Wallet and Apple Pay