pub unsafe trait MEMessageActionHandler: NSObjectProtocol {
// Provided methods
unsafe fn decideActionForMessage_completionHandler(
&self,
message: &MEMessage,
completion_handler: &DynBlock<dyn Fn(*mut MEMessageActionDecision)>,
)
where Self: Sized + Message { ... }
unsafe fn requiredHeaders(&self) -> Retained<NSArray<NSString>>
where Self: Sized + Message { ... }
}MEMessageActionHandler only.Expand description
Methods in this protocol can be used by a mail app extension to perform actions on messages as they are downloaded.
See also Apple’s documentation
Provided Methods§
Sourceunsafe fn decideActionForMessage_completionHandler(
&self,
message: &MEMessage,
completion_handler: &DynBlock<dyn Fn(*mut MEMessageActionDecision)>,
)
Available on crate features MEMessage and MEMessageActionDecision and block2 only.
unsafe fn decideActionForMessage_completionHandler( &self, message: &MEMessage, completion_handler: &DynBlock<dyn Fn(*mut MEMessageActionDecision)>, )
MEMessage and MEMessageActionDecision and block2 only.This is invoked when a message is downloaded. The action set in the completion handler will be performed on the message. Depending on if the full body of the
message has been downloaded the
MEMessageprovided might have the full body data. If the full body is not present the
decisionproperty can be set to
MEMessageActionDecision.invokeAgainWithBodyand this method will be invoked again once the full body is available.
Parameter message: - The message for which the action will be performed. Might or might not contain the full message body data.
Sourceunsafe fn requiredHeaders(&self) -> Retained<NSArray<NSString>>
unsafe fn requiredHeaders(&self) -> Retained<NSArray<NSString>>
Provide additional headers that the extension requires to perform an action. Mail will fetch these additional headers before invoking
-[MEMessageActionHandler``decideActionForMessage:completionHandler:].For example, extensions can return the headers that were set in
-[MEComposeSessionHandler``additionalHeadersForSession:]
Returns: An array of header keys. Mail will normalize the headers to lower case before fetching them from the mail server.