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