/**
* 群发短信
*
* @param shareImage <#shareImage description#>
*/
- (void)sendSMS:(UIImage *)shareImage
withMoblieList:(NSArray *)mobileList
{
MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
if([MFMessageComposeViewController canSendText]) {
NSMutableString *emailBody = [[NSMutableString alloc] initWithString:@""];
picker.messageComposeDelegate = self;
picker.recipients = [[NSArray alloc] initWithArray:mobileList];
[picker setBody:emailBody];// your recipient number or self for testing
picker.body = emailBody;
[picker addAttachmentData:UIImageJPEGRepresentation(shareImage, .6f) typeIdentifier:@"image/jpg" filename:@"res.jpg"];
[self presentViewController:picker animated:YES completion:NULL];
}
* 群发短信
*
* @param shareImage <#shareImage description#>
*/
- (void)sendSMS:(UIImage *)shareImage
withMoblieList:(NSArray *)mobileList
{
MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
if([MFMessageComposeViewController canSendText]) {
NSMutableString *emailBody = [[NSMutableString alloc] initWithString:@""];
picker.messageComposeDelegate = self;
picker.recipients = [[NSArray alloc] initWithArray:mobileList];
[picker setBody:emailBody];// your recipient number or self for testing
picker.body = emailBody;
[picker addAttachmentData:UIImageJPEGRepresentation(shareImage, .6f) typeIdentifier:@"image/jpg" filename:@"res.jpg"];
[self presentViewController:picker animated:YES completion:NULL];
}
}
本文详细介绍了如何使用Objective-C实现群发短信功能,包括使用MFMessageComposeViewController类进行短信发送,添加附件图片,以及处理接收者的手机号列表。通过实例代码展示了群发短信的完整流程,适用于iOS应用开发。
2068

被折叠的 条评论
为什么被折叠?



