if(!TARGET_IPHONE_SIMULATOR){ if ([MFMessageComposeViewController canSendText]){ MFMessageComposeViewController *MFMsgPicker = [[MFMessageComposeViewController alloc] init]; MFMsgPicker.messageComposeDelegate = self; MFMsgPicker.recipients = [NSArray arrayWithObject:@""]; // your recipient number or self for testing MFMsgPicker.body = [NSString stringWithFormat:@"Send from my app"]; if ([MFMessageComposeViewController canSendAttachments]) { // data code for attachment here. worked perfectly. so removed it. NSLog(@"Attachments Can Be Sent."); [self presentViewController:MFMsgPicker animated:YES completion:nil]; } else{ [CommonMethods alertFromCommonMethods:@"Your device doesen't support the iMessage Attachment feature!"]; [appDelegate stopProgressLoading]; } } else{ [CommonMethods alertFromCommonMethods:@"Your device doesen't support the iMessage send text feature!"]; [appDelegate stopProgressLoading]; } } else{ [CommonMethods alertFromCommonMethods:@"Your device doesen't support the iMessage"]; [appDelegate stopProgressLoading]; }
MFMsgPicker.recipients = nil;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)