How to use MMS for audio in iphone?

佐手、 提交于 2019-12-08 09:50:51

问题


I did goggling about MMS in iPhone but I did not find much info on this,most of the findings are related to images. I would like to send audio using MMS in iPhone using ios sdk.Is it possible to do this?I have the following queries regarding MMS.

How to identify all the MMS audio files in iPhone using iOS SDK?

How to play MMS files in iPhone using iOS SDK?

Could some one help me in identifying these things !


回答1:


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");
    }
}    


来源:https://stackoverflow.com/questions/14434330/how-to-use-mms-for-audio-in-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!