-
Crie experiências inteligentes com a Siri usando App Schemas
Integre o conteúdo e as ações do seu app à Siri com o framework App Intents. Modele seus dados usando App Entities, implemente App Schemas para viabilizar ações robustas do sistema e ofereça suporte a interações em linguagem natural impulsionadas pela Apple Intelligence. Descubra como habilitar a busca semântica, realizar ações entre apps e criar experiências contextuais utilizando reconhecimento do conteúdo na tela e transferência de conteúdo. Conheça as práticas recomendadas e ferramentas de teste para desenvolver experiências rápidas e confiáveis com a Siri.
Capítulos
- 0:00 - Introdução
- 1:06 - Novidades na Siri
- 4:06 - Contribuição de conteúdo com App Entities
- 6:21 - Resolução de entidades e IndexedEntity
- 9:49 - Como disponibilizar ações
- 12:03 - Adoção de um domínio de esquema no UnicornChat
- 15:39 - Transferência de conteúdo entre apps
- 16:00 - Como trabalhar em diferentes apps: contexto na tela
- 21:09 - Melhores práticas
- 24:18 - Como testar sua integração
- 26:21 - Próximas etapas
Recursos
- Integrating your messaging app with Apple Intelligence
- Donating your app’s data and actions to the system
- Making app entities available in Spotlight
- Making actions and content discoverable by Apple Intelligence
- Providing contextual cues to Apple Intelligence and Siri
- Apple Intelligence and Siri AI
- Messages
- App schema domains
Vídeos relacionados
WWDC26
-
Buscar neste vídeo...
-
-
7:59 - Contributing message content to Apple Intelligence
// Contributing message content to Apple Intelligence @AppEntity(schema: .messages.message) struct MessageEntity: IndexedEntity { // The text content of the message @Property(indexingKey: \.textContent) var body: AttributedString? } -
8:36 - An interface that locates entities using arbitrary string input
// An interface that locates entities using arbitrary string input struct ContactQuery: EntityStringQuery { func entities(matching string: String) async throws -> [ContactEntity] { let predicate = #Predicate<Person> { person in person.name.localizedStandardContains(string) } let descriptor = FetchDescriptor<Person>(predicate: predicate) let matches = try modelContext.fetch(descriptor) return matches.map(\.entity) } } -
17:19 - Working across apps - View annotations
// Working across apps - View annotations List { ForEach(messages) { message in MessageRow(message: message) .appEntityIdentifier( EntityIdentifier( for: MessageEntity.self, identifier: message.id ) ) } } -
18:18 - Working across apps - Exporting content to another app
// Working across apps - Exporting content to another app extension ContactEntity: Transferable { static var transferRepresentation: some TransferRepresentation { IntentValueRepresentation( exporting: \.person ) } } -
19:21 - Working across apps - IntentValueQuery
// Working across apps - IntentValueQuery struct ContactEntityQuery: IntentValueQuery { func values(for input: [IntentPerson]) async throws -> [ContactEntity] { let names = input.map(\.displayName) let descriptor = FetchDescriptor<Contact>() let contacts = try model.mainContext.fetch(descriptor) let matches = contacts.filter { contact in names.contains(where: { name in contact.name.localizedStandardContains(name) }) } return matches.map(\.entity) } } -
20:00 - Working across apps - IntentValueRepresentation
// Working across apps - IntentValueRepresentation extension ContactEntity: Transferable { static var transferRepresentation: some TransferRepresentation { IntentValueRepresentation(exporting: \.person, importing: { intentPerson in let contact = Contact(importing: intentPerson) ContactManager.shared.contacts.append(contact) return contact.entity }) } }
-