In Mail Kit, MEMessageSecurityHandler.extensionViewController(messageContext:)'s context is always nil.
Any idea why?
class MessageSecurityHandler: NSObject, MEMessageSecurityHandler {
func extensionViewController(messageContext context: Data) -> MEExtensionViewController? {
let controller = ExampleSigningViewController.sharedInstance
controller.msgContext = context // nil ??? why?
return controller
}
I thought it had to do with the MEDecodedMessage.context returned in decodedMessage(forMessageData:) but changing returned the context below still results in the above giving an empty Data.
func decodedMessage(forMessageData data: Data) -> MEDecodedMessage? {
MEDecodedMessage(
data: data,
securityInformation: MEMessageSecurityInformation(
signers: [],
isEncrypted: true,
signingError: nil,
encryptionError: nil),
context: data, // extensionViewController(messageContext:)'s context is still empty
banner: nil)
Env:
macOS Ventura 13.4.1 (c) (22F770820d)
Mail Version 16.0 (3731.600.7)
Xcode 14.2
Post
Replies
Boosts
Views
Activity
My app's Mail Extension uses the MEMessageSecurityHandler and its decoding functions but opening various emails is noticeably slower, sometimes taking 3-5s, especially on emails with attachments. Specifically, the time it takes from selecting an email from the list to the email body/contents to show up on the right panel is slow, even showing "loading" with the spinner icon. In comparison, when I disable the Mail Extension, emails open in less than a second as expected. Curiously, the "Build Mail app extensions" WWDC sample project seems to have the exact same issue despite having minimal functionality (passes through the mime data without doing any processing on it).
Any idea?
Env:
macOS Ventura 13.4.1 (c) (22F770820d)
Mail Version 16.0 (3731.600.7)
Xcode 14.2