Closed uwantfries closed 6 years ago
Where does file exists on iOS? Could you print out the complete file path? I wonder if your app have any permission to access it.
Have you tried using "application/octet-stream" instead of "application/pdf"?
Thanks. I will try those suggestions.
I am marking this issue closed since there is no activity for 30 days. Please reopen if you continue to have any issues
I am getting the following error on IOS when calling the code from PCL
System.ArgumentNullException: Value cannot be null. Parameter name: attachment
at MessageUI.MFMailComposeViewController.AddAttachmentData (Foundation.NSData attachment, System.String mimeType, System.String fileName) [0x00076] in /Users/builder/data/lanes/4691/d2270eec/source/xamarin-macios/src/build/ios/native/MessageUI/MFMailComposeViewController.g.cs:104 at Plugin.Messaging.EmailTask.SendEmail (Plugin.Messaging.IEmailMessage email) [0x00101] in:0
at XApp.MainPage.btnTestEmail_Clicked (System.Object sender, System.EventArgs e) [0x000bb] in <76d8f2c0683744789d54752507752bfd>:0
at Xamarin.Forms.Button.SendClicked () [0x00021] in <937957814f5d45be82b66795cb584841>:0
at Xamarin.Forms.Platform.iOS.ButtonRenderer.OnButtonTouchUpInside (System.Object sender, System.EventArgs eventArgs) [0x00011] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.iOS\Renderers\ButtonRenderer.cs
:125
The file does exist on the file system and is readable (I can open the PDF elsewhere in my proj)
The code I am using is
var emailTask = MessagingPlugin.EmailMessenger; if (emailTask.CanSendEmail) { string path = "00000018.pdf";