In this recipe, we will learn how to provide text messaging functionality within our application using the native messaging user interface.
Add a button on the view of
MainController
. Enter the following using directive in theMainController.cs
file:using MonoTouch.MessageUI;
Implement the
ViewDidLoad
method with the following code, changing the recipient number and/or the message body at your discretion:private MFMessageComposeViewController messageController; public override void ViewDidLoad (){ base.ViewDidLoad (); this.buttonSendMessage.TouchUpInside += delegate { if (MFMessageComposeViewController.CanSendText){ this.messageController = new MFMessageComposeViewController(); this.messageController.Recipients = new string[] { "+123456789012" }; this.messageController.Body = "Text from MonoTouch"; this.messageController.MessageComposeDelegate...