如何从iPhone应用程序发送彩信
在我的新iOS项目中,我希望最终用户能够在UIButton Action中使用MMS text and/or images
(来自TextField)。 我见过类似的应用程序,有这个function(文字,还没有看到一个与图像呢)。
我在谷歌search,但无法find如何做到这一点,任何帮助非常感谢
这将工作正常
MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init]; UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; pasteboard.persistent = YES; pasteboard.image = [UIImage imageNamed:@"PDF_File.png"]; NSString *phoneToCall = @"sms:"; NSString *phoneToCallEncoded = [phoneToCall stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]; NSURL *url = [[NSURL alloc] initWithString:phoneToCallEncoded]; [[UIApplication sharedApplication] openURL:url]; if([MFMessageComposeViewController canSendText]) { NSMutableString *emailBody = [[NSMutableString alloc] initWithString:@"Your Email Body"]; picker.messageComposeDelegate = self; picker.recipients = [NSArray arrayWithObject:@"123456789"]; [picker setBody:emailBody];// your recipient number or self for testing picker.body = emailBody; NSLog(@"Picker -- %@",picker.body); [self presentModalViewController:picker animated:YES]; NSLog(@"SMS fired"); }
- 排除Xcode 7代码覆盖范围内的文件/行数
- 如何在Swift中存档和取消存档自定义对象? 或者如何将自定义对象保存到Swift中的NSUserDefaults?
- 如何将button添加到InAppSettingsKit设置视图(iPhone / iPad)?
- Xcode 7 GM创build了通用存档,而不是iOS应用程序存档
- 视图加载之前,位置不更新
- 如何从自定义类创build和取消唯一的UILocalNotification?
- 在命令行中使用OTHER_LDFLAGS,iOS应用程序生成命令行
- iOS – 子类MFMessageComposeViewController添加额外的function
- 如何更优雅地添加/删除表格视图中的单元格?