Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dannycabrera/0f22f7b8abcfb608560a to your computer and use it in GitHub Desktop.
Save dannycabrera/0f22f7b8abcfb608560a to your computer and use it in GitHub Desktop.
Send MMS with Image Attachment using Xamarin.iOS
//Source: http://davidsonblake.wordpress.com/2014/05/29/send-mms-with-image-attachment-using-xamarin-ios/
void SendMMS ()
{ //Init View Controller
var messageController = new MFMessageComposeViewController ();
//Verify app can send text message
if(MFMessageComposeViewController.CanSendText)
{
messageController.Body = "Here's an image for u 2 n joy.";
//Add attachment as NSData, and set the uti
messageController.AddAttachment (UIImage.FromFile ("chimp.png").AsPNG (); , "kUTTypePNG", "image.png");
messageController.Finished += (sender, e) => (DismissViewController (true, null));
this.PresentViewController (messageController, true, () => ViewModel.IsBusy = false);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment