Contents

INInteraction

An interaction between the user and your app involving an intent object.

Declaration

class INInteraction

Mentioned in

Overview

An INInteraction object encapsulates information about a SiriKit request and your app’s response. SiriKit creates interaction objects automatically when it needs your app to respond to a specific intent, either by handling the intent or providing an error explaining why your app couldn’t handle the intent. SiriKit places the interaction in an NSUserActivity object that the system passes to your app at launch time. You can also create instances of this class in your app and donate relevant interactions to the system.

Donating interactions provides contextual information that might be helpful to other apps. Some system apps use donated interactions to improve search results or to anticipate user actions. For example, a ride-booking app could donate an interaction containing the user’s planned ride information. If the user subsequently uses the Maps app to search for restaurants, Maps can show relevant results near the user’s destination.

You choose which of your app’s interactions you want to donate to the system. To donate an interaction, create an instance of this class, filling it with your intent object and response, and call the donate(completion:) method. You can also use the methods of this class to delete interactions when they are no longer relevant.

Topics

Creating an Interaction Object

Getting the Intent and Response

Donating Interactions to the System

Deleting Interactions from the System

Accessing Interaction Attributes

Getting the Value of a Parameter

Constants

Initializers

See Also

Shortcuts and Donations