2015-10-02 55 views
-2

我是iOS編程新手,我知道這個問題太老了,但我在這裏關於消息控制器很困惑。我想創建一個我想發送簡單消息的應用程序。 如果我設置了多個收件人,您可以查看所有收件人嗎? 如果是這樣,那我該如何爲所有人制作私人信息,以便一個收件人無法查看其他收件人?消息控制器iOS

這裏是我撰寫郵件的多個收件人

- (void)showSMS:(NSString*)file { 

    if(![MFMessageComposeViewController canSendText]) { 
    UIAlertView *warningAlert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Your device doesn't support SMS!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; 
     [warningAlert show]; 
     return; 
    } 

    NSArray *recipents = @[@"12345678", @"72345524"]; 
    NSString *message = [NSString stringWithFormat:@"Just sent the %@ file to your email. Please check!", file]; 

    MFMessageComposeViewController *messageController = [[MFMessageComposeViewController alloc] init]; 
    messageController.messageComposeDelegate = self; 
    [messageController setRecipients:recipents]; 
    [messageController setBody:message]; 
    [self presentViewController:messageController animated:YES completion:nil]; 
} 
+0

你試過了嗎?發生了什麼? – Paulw11

+0

我嘗試太多,但我沒有找到解決辦法。我說謝謝我提前幫助我解決這個問題的會員 –

+0

我的意思是,用您當前的代碼可以收件人1看到郵件也發送到收據2?如果是這樣,那麼你將不得不發送多個單獨的消息。這可能是內置的消息支持可能不適合您的應用程序。您可能需要使用商業服務 – Paulw11

回答

1

有中設置的設置代碼 - >信息即禁用組消息和所有收件人將分別接收消息。除此之外,您無法使用MFMessageComposeViewController,因爲沒有密件抄送選項。你可以一次發送一條消息,雖然