How to use MMS for audio in iphone?

此生再无相见时 提交于 2019-12-08 13:09:29

MMS as in Multimedia Messaging Service is not available for a developer in iOS. Only the messages.app can send MMS, you can't access any data from the messages.app nor can you send an MMS.

The iOS SDK provides Message UI Framework which allows you to send Email and Text messages. But the text messages are restricted to SMS only.


Update: iOS 7 now supports attachment.

 - (void)sendAudioFile:(NSURL)audioFilePath {
    if ([MFMessageComposeViewController canSendAttachments] &&
        [MFMessageComposeViewController canSendText] &&
        [MFMessageComposeViewController isSupportedAttachmentUTI:@"com.apple.coreaudio-​format"]) //.caf files
    { 
        NSLog(@"can send");

        MFMessageComposeViewController *message = [[MFMessageComposeViewController alloc] init];
        [message addAttachmentURL:audioFilePath withAlternateFilename:nil]; //.caf file
        message.messageComposeDelegate = self;
        [self presentViewController:message animated:YES completion:nil];
    }
    else {
        NSLog(@"cannot send");
    }
}    
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!