I'm trying to get my head around adopting AppEntity schemas. Is it OK to shoehorn a closely-related concept from our apps into AppEntity schemas, even if they'r not a perfect fit?
For e.g. I have 'tasks' in my app, that are related to a 'person' entity. Would it work to adopt a schema like
@AppEntity(schema: .reminders.reminder)
struct TaskEntity: IndexedEntity {
var personForTask: PersonEntity
... fill in other required fields
}
Most of the fields are optional or arrays, so it could work, but one of the required fields seems to be var list: ListEntity, so I would have to conform to that in some way.
Similarly, I would want to adopt the .reminders.createReminder @AppIntent for my app, even though I won't be able to support all the parameters that it can support. Would that be OK as well?
We recommend you to adopt schemas that match your apps's capabilities. Since you mentioned your has a concept of a task, creating an AppEntity that conforms to the reminder entity schema and indexing it to Spotlight allows Siri AI to answer questions over your app's tasks.
In addition to that, you can adopt the createReminder intent schema to allow Siri to create tasks on your user's behalf. You can use the new AppIntentsTesting framework to author unit tests that validate your adoption.
For any parameters your app doesn't support, you can simply ignore them in the perform action or in the case of list, assign a default List entity. Once adopted, you can validate the scenario end-to-end with Siri to verify the experience.