I use the following code in my application to create and populate SMS to send to the user. This code is called by pressing UIButton.
MFMessageComposeViewController *controller = [[[MFMessageComposeViewController alloc] init] autorelease]; if([MFMessageComposeViewController canSendText]) { controller.body = @"Hello from Mugunth"; controller.recipients = [NSArray arrayWithObjects:@"12345678", @"87654321", nil]; controller.messageComposeDelegate = self; [self presentModalViewController:controller animated:YES]; }
When I first load the view, I would like to check the capabilities of the device and, if necessary, hide the button (for example, on iPod touch).
Does anyone have code examples on how to do this? Please note that I focus only on iOS 4.0 and higher, I know that the above code will not work on devices using earlier versions of iOS.
Hello
source share