简体   繁体   English

通过MessageUI在应用程序中发送短信

[英]Sending a SMS in app through MessageUI

Please help to solve the issue of sending invites to the app via SMS or iMessage. 请帮助解决通过SMS或iMessage向应用发送邀请的问题。

The issue is that when all the receipents of the message have iMessage available (blue button), then upon invitation sending a group consisting of these people gets created, but I need to send the messages separately (not in group). 问题是,当邮件的所有接收方都具有iMessage可用时(蓝色按钮),则在受邀请时会创建一个由这些人组成的组,但我需要单独发送邮件(不在组中)。

if MFMessageComposeViewController.canSendText() {
        let messageViewController = MFMessageComposeViewController()

        messageViewController.body = "Some invite text"
        messageViewController.recipients = [phone_numbers_from_contacts]
        messageViewController.messageComposeDelegate = self

        self.present(messageViewController, animated: true, completion: nil)
    } else {
        // Some alert with text "SMS services are not available"
    }

AFAIK you have no control over whether the message is sent as a group message or not. AFAIK,您无法控制邮件是否作为群发消息发送。

If you want to send it as individual messages then I would suggest using multiple different instances of the MFMessageComposeViewController . 如果您想将其作为单独的消息发送,那么我建议使用MFMessageComposeViewController多个不同实例。

TBH though, you shouldn't really be using this for sending out spam texts anyway. 但是,TBH绝对不应该使用它来发送垃圾邮件文本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM