public enum IntentSource

  1. Object
  2. Enum<IntentSource>
  3. IntentSource

ImplementsComparable<IntentSource>

Where an intent invocation came from.

Handlers should rarely branch on this – an intent that behaves differently depending on who asked is a bug waiting to happen – but it is useful for analytics, for tailoring the spoken line, and for deciding how much detail a snippet should carry.

Enum constants

VOICEA voice assistant, where the platform says so.
SPOTLIGHTThe user tapped an item this app published through Intents.index.
SHORTCUTA shortcut the user placed or the system suggested: the Shortcuts app, an iOS App Shortcut, or an Android launcher shortcut.
WIDGETA button on a home-screen widget or live activity bound to this intent.
IN_APPAn in-app call to Intents.invoke, including the simulator’s Intents window.
MODELA language model calling the intent as a tool, through the projection Intents.asTools() exposes.
UNKNOWNThe platform did not say, or the source is one this version does not model.

Methods

public static IntentSource[] values()
public static IntentSource valueOf(String name)

Inherited methods

Enum constant details

VOICE

VOICE

A voice assistant, where the platform says so.

iOS does not: an App Intent’s perform() is not told whether Siri, the Shortcuts app or a home-screen App Shortcut ran it, so all three arrive as UNKNOWN rather than one of them claiming to be Siri. Do not write a branch that expects this on a device; the simulator can still produce it, which is how the path is exercised.

SPOTLIGHT

SPOTLIGHT
The user tapped an item this app published through Intents.index.

SHORTCUT

SHORTCUT
A shortcut the user placed or the system suggested: the Shortcuts app, an iOS App Shortcut, or an Android launcher shortcut.

WIDGET

WIDGET
A button on a home-screen widget or live activity bound to this intent.

IN_APP

IN_APP
An in-app call to Intents.invoke, including the simulator’s Intents window.

MODEL

MODEL
A language model calling the intent as a tool, through the projection Intents.asTools() exposes.

UNKNOWN

UNKNOWN

The platform did not say, or the source is one this version does not model.

This is the ordinary case for an iOS App Intent, which is invoked by Siri, the Shortcuts app or an App Shortcut without disclosing which – so it is not a rare fallback and carries no implication that the app is on screen. Take it as exactly what it says: the source is unknown. Anything that needs to be certain should be true for every source.

Method details

values

public static IntentSource[] values()

valueOf

public static IntentSource valueOf(String name)