Hi, I have an existing app with AppEntities defined, that works on iOS17+. The AppEntities also have EntityPropertyQuery defined, so they work as 'find intents'. I want to use the new @AssistantEntity which is iOS18+ where possible, while supporting the previous versions. What's the best way to do this?
For e.g. I have a 'log' AppEntity:
@available(iOS 17.0, *)
struct CJLogAppEntity: AppEntity {
static var defaultQuery = CJLogAppEntityQuery()
....
}
struct CJLogAppEntityQuery: EntityPropertyQuery {
...
}
How do I adopt this with @AssistantEntity(schema: .journal.entry) for iOS18, while maintaining compatibility with iOS17? I don't want to include two different versions of the same AppEntity. Would it just with with the correct @available annotations on both entities?
Thanks for filing the bug report — we'll take a look. In the meantime, you can work around this macro limitation by creating two versions of your App Intent: one available on iOS 17+ and another available on iOS 27+. I recommend overriding the isAssistantOnly property to true on the iOS 27 version so it's available to Siri AI, while the iOS 17 version remains available to other clients like Shortcuts and the Action Button.