donate(intent:)
Donates the specified app intent to the system synchronously.
Declaration
@discardableResult func donate(intent: some AppIntent) -> IntentDonationIdentifierParameters
- intent:
An app intent for an action the person performed. Include enough information in the app intent for you to recreate the action later.
Return Value
A unique identifier you can use to refer to the donation later. The method returns this value whether the donation succeeds or fails.
Discussion
When someone completes an action in your app, call this method to donate a matching app intent. The system doesn’t run the app intent you provide, but uses the information to predict future actions. If an error occurs during the donation process, this method ignores the error.