donate(result:)
Donates the app intent and a result to the system asynchronously.
Declaration
@discardableResult func donate(result: some IntentResult) async throws -> IntentDonationIdentifierParameters
- result:
The effective result of the intent. Use this parameter to specify the result your intent would have returned. For example, if the action opened another item, include a result with a related Openintent type.
Return Value
An opaque identifier you can use to manage the donation later using an IntentDonationManager type.
Discussion
When someone interacts with your app’s interface, create an app intent for the interaction and call this method. Use this method when the result of the intent is also relevant, such as when the result of the action triggers another app intent. Donating intents helps the system predict future actions and improve the overall system experience. Don’t donate app intents that the system creates and asks you to handle.