我已成功使用以下代码将图像复制或添加到粘贴板:
I have successfully able to copy or add the image to pasteboard by using following code:
if (ver_float < 6.0) { UIPasteboard *pasteboard; pasteboard = [UIPasteboard generalPasteboard]; NSString *filePath =pathToImage; [pasteboard setImage:[UIImage imageWithContentsOfFile:filePath]]; } else { UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; NSString *filePath =pathToImage; NSData *videoData = [NSData dataWithContentsOfFile:filePath]; [pasteboard setData:videoData forPasteboardType:[UIPasteboardTypeListImage objectAtIndex:0]]; } NSURL *urlstr = [NSURL URLWithString:@"sms:"]; [[UIApplication sharedApplication] openURL:urlstr];但我正在制作的应用程序基于图像和视频,因此用户将能够通过imessage或messagecomposer发送图像/视频。但是因为我已将图像转换为数据并添加到粘贴板中。它正在成功运作并通过imessage发送。但我还需要通过imessage发送视频。如果有人对此有任何想法,请提供一些建议或解决方案。
But the app which I am making is based on both images and videos so that user will be able to send image/video via imessage or messagecomposer. But as I have convert the image into data and added into pasteboard. It is working succesfully and sending through imessage. But I also need to send video via imessage. If anyone has any idea about this please provide me some suggestion or solution.
我非常感谢你的帮助。
推荐答案我在从SMS发送音频文件时也遇到了同样的问题。 但是使用当前的SDK无法从SMS发送视频和音频。 您可以将该视频上传到服务器,然后发送上传的网址。
I have also faced the same issue in sending audio file from SMS. But sending video and audio from SMS is not possible with current SDK. You can do this by uploading that video to server and then send that uploaded URL.
如何以编程方式在iPhone上发送语音邮件?
更多推荐
将视频复制到uipasteboard
发布评论