Build Mail app extensions

RSS for tag

Discuss the WWDC21 session Build Mail app extensions.

View Session

Posts under wwdc21-10168 tag

19 results found
Sort by:
Post not yet marked as solved
298 Views

MEComposeSessionHandler alert message not shown

When the mail extension invoke allowMessageSendForSession func, the error prompt did not show the error description. What am I missing? Below is the code:     enum ComposeSessionError: LocalizedError {         case invalidRecipientDomain                  var errorDescription: String? {             switch self {             case .invalidRecipientDomain:                 return "example.com is not a valid recipient domain"             }         }     }          func allowMessageSendForSession(_ session: MEComposeSession) async throws {         // Before Mail sends a message, your extension can validate the         // contents of the compose session. If the message isn't ready to be         // sent, throw an error.         throw ComposeSessionError.invalidRecipientDomain     }
Asked Last updated
.
Post not yet marked as solved
27 Views

mail app crash on catalina 10.15

terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'V3->V4 migrator must be run before persistence version can be migrated to V5' terminating with uncaught exception of type NSException abort() called How to run migrator/ how to fix this issue?
Asked
by johnherdz.
Last updated
.
Post not yet marked as solved
76 Views

MailKit API Documentation

Does any have anyone have documentation on the usage related to the forMessageContext and messageContext parameters and for the methods below? This is undocumented while public making it an unusable API. func extensionViewController(messageContext: Data) -> MEExtensionViewController? func primaryActionClicked(forMessageContext context: Data) async -> MEExtensionViewController? The APIs are located here but lack any kind of proper documentation and examples https://developer.apple.com/documentation/mailkit/memessagesecurityhandler/3882908-extensionviewcontroller
Asked
by MobileTen.
Last updated
.
Post not yet marked as solved
131 Views

Unable to construct MEDecodedMessage since Monterey Beta 7

I've already created feedback id FB9647811 about this, but as there has been no response to that I was wondering if anyone else had experienced the same or found a fix. My extension was working until Monterey beta 7 but now it crashes with the following message: [MEDecodedMessage initWithData:securityInformation:]: unrecognized selector sent to instance According to the documentation this is the correct constructor.
Asked Last updated
.
Post not yet marked as solved
65 Views

MailExtension cannot block sending a mail

when I throw an exception in the func allowMessageSendForSession(_ session: MEComposeSession), the mail.app will show alert with two buttons: "cancel" and "send anyway", if I press the "send anyway" then the mail will be sent successfully! I'm wondering: how to really stop sending email? Thanks
Asked Last updated
.
Post not yet marked as solved
104 Views

Issue in Mailto url encoding in latest iOS version

Hello, I am not able to use or \n to take a new line in the email body in the default iOS mail application. Example: mailto:abc@gmailDOTcom?subject=test&body=Hello,mailBody Result in latest iOS mail app: Hello,mailBody Expected result: Hello, mailBody Will you please help me to resolve this issue?
Asked Last updated
.
Post not yet marked as solved
85 Views

Mail app. 15.0 will not display body of email and constantly connecting to iCloud

The system is 2019 27 iMac Operating system is macOS Monterey 12.0.1 Mac Mail version 15.0 I have two email accounts set up on from gmail and on from iCloud. The gmail account works fine it's only the iCloud account that is having issues. to date I have tried rebuilding the mailbox. going into ~/library/Mail/V9/MailData/ moving Envelope Index ExternalUpdates.storedata to my desktop and deleting any other files with same name than restarting mail.  these have no affect the body of the messages will not display I have noticed that opening activity and connection doctor mail is constantly connecting to iCloud nonstop [https://drive.google.com/file/d/14_OQk3WHuOwI6hig2Bb2hSro3Urg7kdA/view?usp=sharing)
Asked
by rex61.
Last updated
.
Post not yet marked as solved
145 Views

Raw data is incomplete in MEMessageActionHandler

We get message rawdata from the following function: func decideActionForMessage(for message: MEMessage, completionHandler: @escaping (MEMessageActionDecision?) -> Void) But raw data is not nil, and it is incomplete, invokeAgainWithBody will not fix this problem. How can we get the entire body message?
Asked
by Cotin.
Last updated
.
Post not yet marked as solved
285 Views

HTML Signature Font Issue in Apple Mail

I have added an HTML signature to the Apple Mail, whenever I hit compose the font is the same, but when I hit send and receive the email, the font changes to something of a similar version. I have used a custom font in the email signature. Why does this issue happen?
Asked Last updated
.
Post marked as solved
329 Views

Body data missing in decodedMessage call

I have a multipart message and in the MEMessageSecurityHandler.decodedMessage(forMessageData:) function call, I can access all of the headers of the email, but when I get to the body section, the actual content of the email is missing. I've dumped the data out to a file and can see that there is an X-Apple-Content-Length header been added, but the content of the multipart email --=-=W2HxPVXDSaWZZw=-= X-Apple-Content-Length: 11 Content-Type: application/pgp-encrypted --=-=W2HxPVXDSaWZZw=-= Content-Transfer-Encoding: 7Bit Content-Disposition: inline; filename=openpgp-encrypted-message.asc Content-Type: application/octet-stream; name="openpgp-encrypted-message.asc" X-Apple-Content-Length: 9608 --=-=W2HxPVXDSaWZZw=-=-- How can I access the content of these parts to decrypt the message?
Asked Last updated
.
Post not yet marked as solved
281 Views

How can I download the attachment in decodedMessage

In decodedMessage, I got the raw message Data. How can I get the attachment with this information? --Apple-Mail=_7074F225-9F70-4410-B0AC-15891A766688 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Content --Apple-Mail=_7074F225-9F70-4410-B0AC-15891A766688 Content-Transfer-Encoding: base64 Content-Disposition: ATTACHMENT; filename*=utf-8''%E5%8D%97%E4%BA%AC%E5%8D%87%E5%AD%A6%E5%AD%A32021.pptx Content-Type: application/vnd.openxmlformats-officedocument.presentationml.presentation; name="=?utf-8?B?5Y2X5Lqs5Y2H5a2m5a2jMjAyMS5wcHR4?="; x-unix-mode=0700 X-Apple-Content-Length: 2299846 --Apple-Mail=_7074F225-9F70-4410-B0AC-15891A766688--
Asked
by Cotin.
Last updated
.
Post not yet marked as solved
270 Views

Reload Mail Extensions

When the JSON file with all the rules is changed from the container app do you need to reload the content blocker like you need to do in Safari? If yes, how do you reload? And can you get the content blocker activation status?
Asked
by LH16.
Last updated
.
Post not yet marked as solved
448 Views

Use of XPC Services from mailKit

Thanks for this excellent session about Mailkit at WWDC. Using the sample code from the session, I added a new XPC Service Target and am trying to call remote objects via the NSXPCInterface from within mailComposeSessionDidBegin. No success. I can verify that the XPC Service is working fine when I make the same calls to the service from the AppDelegate class' applicationDidFinishLaunching function. So, my question is if mailKit extensions are blocking XPC service invocations?
Asked
by kkschulz.
Last updated
.
Post marked as Apple Recommended
357 Views

Access to mailboxes and folders?

MailKit looks exciting. Is there a mechanism to be able to access or interact with messages at rest? More specifically: Get a list of folders Be able to read or even modify each message in a folder Get the read status of a message Be notified when a message is moved, deleted or the read status changes Move messages between folders Thanks!
Asked Last updated
.