donateIntent method
Donates an executed intent so Siri / Apple Intelligence can learn that the user performed this action in-app (#55).
Wraps AppIntent.donate() (stable iOS 16+). identifier must match an
intent declared @IntentSpec(donatable: true); params is the parameter
map you'd otherwise pass at execution time — the reverse executor
reconstructs the concrete intent from it before calling .donate().
iOS-only; a no-op on other platforms. See
docs/adr/0003-donations-and-discovery.md.
Implementation
@override
Future<void> donateIntent(
String identifier,
Map<String, dynamic> params,
) async {
try {
await methodChannel.invokeMethod('donateIntent', {
'identifier': identifier,
'params': params,
});
} on MissingPluginException {
// No-op on platforms that don't implement this (e.g., Android).
// Intent donation is iOS-specific.
}
}