One Logo Pool Ball
AppIntents · IOS API REFERENCE

RelevantEntities

struct · iOS 27.0+ · SDK 27.1

struct RelevantEntities

A type you use to donate your app's songs, albums, artists, and other media items to play during workouts. Use the shared `RelevantEntities` object to donate songs, albums, artists, playlists, radio stations, podcasts, or other media-related content to the system. Base your donations on whatever criteria makes sense for your app. For example, you might donate songs that someone listens to frequently or donate new items that you think someone might like based on their tastes. The system uses your donations to offer suggestions for content someone can play during a workout or other scenario. When you donate media items using this type, provide all the items at once using the ``RelevantEntities/updateSuggestedEntities(_:)`` method. Apps provide only one set of suggestions at a time, and those suggestions remain active until you clear them. Each time you call the ``RelevantEntities/updateSuggestedEntities(_:)`` method, the system replaces your app's previous suggestions with the new set. If you don't have any suggestions, you can specify an empty array when calling the method. If someone doesn't launch your app, the system automatically expires your app's suggestions after approximately four weeks.

Members (6)

method · iOS 27.0+

removeEntities

TypeScript
removeEntitiesFrom(entities: Array<SDKHandle>, context: AppEntityContext): Promise<void>
Swift declaration
func removeEntities(_ entities: [any AppEntity], from context: AppEntityContext) async throws

Removes specific entities from the given context. - Parameters: - entities: The entities to remove. - context: The context from which to remove the entities. - Throws: An error if the removal fails.

method · iOS 27.0+

removeEntities

TypeScript
removeEntities(entities: Array<SDKHandle>): Promise<void>
Swift declaration
func removeEntities(_ entities: [any AppEntity]) async throws

Removes the specified entities across all contexts. - Parameter entities: The entities to remove from all contexts. - Throws: An error if the removal fails.

method · iOS 27.0+

updateEntities

TypeScript
updateEntities(entities: Array<SDKHandle>, context: AppEntityContext): Promise<void>
Swift declaration
func updateEntities(_ entities: [any AppEntity], for context: AppEntityContext) async throws

Donates suggested entities for a single context. Replaces any previously donated entities associated with the given context. - Parameters: - entities: The entities to donate. - context: The context with which to associate the donated entities. - Throws: An error if the donation fails.

method · iOS 27.0+

removeAllEntities

TypeScript
removeAllEntitiesFor(context: AppEntityContext): Promise<void>
Swift declaration
func removeAllEntities(for context: AppEntityContext) async throws

Removes all donated entities for the given context. - Parameter context: The context whose donated entities should be removed. - Throws: An error if the removal fails.

method · iOS 27.0+

removeAllEntities

TypeScript
removeAllEntities(): Promise<void>
Swift declaration
func removeAllEntities() async throws

Removes all suggested entities across all contexts. - Throws: An error if the removal fails.

get · iOS 27.0+

shared

TypeScript
static get shared(): RelevantEntities
Swift declaration
static let shared: RelevantEntities

The shared instance of this class.

Skipped declarations

No declarations were skipped in this snapshot.

All AppIntents types →