One Logo Pool Ball
AppIntents · IOS API REFERENCE

AppSchema.MessagesEntity

protocol · iOS 27.0+ · SDK 27.1

protocol MessagesEntity : AppSchema.Kind

Identifies entity schemas in the messages domain.

Members (4)

get · iOS 27.0+

conversation

Swift declaration
var conversation: some AppSchemaEntity { get }

An entity schema for a conversation. To make your app's content available to Apple Intelligence, conform your ``AppEntity`` to a schema that describes your content to the system. If your app's functionality aligns with the `messages` domain and its content matches the `conversation` schema, you can generate the properties and protocol conformance the schema requires for your app entity implementation with the `@AppEntity( .messages.conversation)` Swift macro. To make your app work with Siri, see <doc://com.apple.documentation/documentation/appintents/apple-intelligence-and-siri-ai>. The following example shows an app entity that conforms to the `conversation` schema: ```swift @AppEntity(schema: .messages.conversation) struct ConversationEntity { // MARK: Static static let defaultQuery = ConversationEntityQuery() // MARK: Properties let id: <#Identifiable.ID#> var recipients: [<#MessagePerson#>] var displayName: String var previewText: AttributedString var conversationName: String? var isRead: Bool var attributes: Set<<#ConversationAttribute#>> var dateLastActive: Date? var displayRepresentation: DisplayRepresentation { <#DisplayRepresentation#> } // MARK: Query struct ConversationEntityQuery: EntityQuery { func entities(for identifiers: [ConversationEntity.ID]) async throws -> [ConversationEntity] { <#code#> } } } ``` The schema supports the following system experiences: - Siri - Shortcuts For more information about the App Intents framework and the experiences it supports, see <doc://com.apple.documentation/documentation/appintents/getting-started-with-the-app-intents-framework>.

get · iOS 27.0+

messagePerson

Swift declaration
var messagePerson: some AppSchemaEntity { get }

An entity schema for a message person. To make your app's content available to Apple Intelligence, conform your ``AppEntity`` to a schema that describes your content to the system. If your app's functionality aligns with the `messages` domain and its content matches the `messagePerson` schema, you can generate the properties and protocol conformance the schema requires for your app entity implementation with the `@AppEntity( .messages.messagePerson)` Swift macro. To make your app work with Siri, see <doc://com.apple.documentation/documentation/appintents/apple-intelligence-and-siri-ai>. The following example shows an app entity that conforms to the `messagePerson` schema: ```swift @AppEntity(schema: .messages.messagePerson) struct MessagePerson { // MARK: Static static let defaultQuery = MessagePersonQuery() // MARK: Properties let id: <#Identifiable.ID#> var person: IntentPerson var displayRepresentation: DisplayRepresentation { <#DisplayRepresentation#> } // MARK: Query struct MessagePersonQuery: EntityQuery { func entities(for identifiers: [MessagePerson.ID]) async throws -> [MessagePerson] { <#code#> } } } ``` The schema supports the following system experiences: - Siri - Shortcuts For more information about the App Intents framework and the experiences it supports, see <doc://com.apple.documentation/documentation/appintents/getting-started-with-the-app-intents-framework>.

get · iOS 27.0+

customAttachment

Swift declaration
var customAttachment: some AppSchemaEntity { get }

An entity schema for a custom attachment. To make your app's content available to Apple Intelligence, conform your ``AppEntity`` to a schema that describes your content to the system. If your app's functionality aligns with the `messages` domain and its content matches the `customAttachment` schema, you can generate the properties and protocol conformance the schema requires for your app entity implementation with the `@AppEntity( .messages.customAttachment)` Swift macro. To make your app work with Siri, see <doc://com.apple.documentation/documentation/appintents/apple-intelligence-and-siri-ai>. The following example shows an app entity that conforms to the `customAttachment` schema: ```swift @AppEntity(schema: .messages.customAttachment) struct CustomAttachment { // MARK: Static static let defaultQuery = CustomAttachmentQuery() // MARK: Properties let id: <#Identifiable.ID#> var sourceName: AttributedString? var description: AttributedString? var displayRepresentation: DisplayRepresentation { <#DisplayRepresentation#> } // MARK: Query struct CustomAttachmentQuery: EntityQuery { func entities(for identifiers: [CustomAttachment.ID]) async throws -> [CustomAttachment] { <#code#> } } } ``` The schema supports the following system experiences: - Siri - Shortcuts For more information about the App Intents framework and the experiences it supports, see <doc://com.apple.documentation/documentation/appintents/getting-started-with-the-app-intents-framework>.

get · iOS 27.0+

message

Swift declaration
var message: some AppSchemaEntity { get }

An entity schema for a message. To make your app's content available to Apple Intelligence, conform your ``AppEntity`` to a schema that describes your content to the system. If your app's functionality aligns with the `messages` domain and its content matches the `message` schema, you can generate the properties and protocol conformance the schema requires for your app entity implementation with the `@AppEntity( .messages.message)` Swift macro. To make your app work with Siri, see <doc://com.apple.documentation/documentation/appintents/apple-intelligence-and-siri-ai>. The following example shows an app entity that conforms to the `message` schema: ```swift @AppEntity(schema: .messages.message) struct MessageEntity { // MARK: Static static let defaultQuery = MessageEntityQuery() // MARK: Properties let id: <#Identifiable.ID#> var messageType: <#MessageType#> var author: <#MessagePerson#> var isRead: Bool var attributes: Set<<#MessageAttribute#>> var conversation: <#ConversationEntity#> var date: Date var subject: AttributedString? var body: AttributedString? var attachments: [IntentFile] var audioMessage: IntentFile? var customAttachments: [<#CustomAttachment#>] var locations: [GeoToolbox.PlaceDescriptor] var links: [LinkPresentation.LinkMetadata] var messageEffect: <#MessageEffect#>? var reaction: <#ReadReaction#>? var referencedMessage: <#MessageEntity#>? var notificationIdentifier: String? var displayRepresentation: DisplayRepresentation { <#DisplayRepresentation#> } // MARK: Query struct MessageEntityQuery: EntityQuery { func entities(for identifiers: [MessageEntity.ID]) async throws -> [MessageEntity] { <#code#> } } } ``` The schema supports the following system experiences: - Siri - Shortcuts For more information about the App Intents framework and the experiences it supports, see <doc://com.apple.documentation/documentation/appintents/getting-started-with-the-app-intents-framework>.

Skipped declarations

No declarations were skipped in this snapshot.

All AppIntents types →