MFMailComposeViewController and privacy - hiding the To: field?

前端 未结 2 567
时光说笑
时光说笑 2021-01-25 10:06

I am creating my second iPhone app, and I\'ve included a feedback form using MFMailComposeViewController. This displays and works correctly, but I\'m not sure I want all my user

2条回答
  •  再見小時候
    2021-01-25 10:40

    I had the same request from a client where they wanted to mask the email address from the end user. Figured it out by using a formatted email address: displayString

    NSString *yourEmail = @"myemail@gmail.com";
    MFMailComposeViewController *mailComposer = [[MFMailComposeViewController alloc] init];
    NSString *emailString = [NSString stringWithFormat:@"App Feedback <%@>", yourEmail];
    [mailComposer setToRecipients:@[emailString]];
    

    It effectually gets you the first image below in the email composer. Then the user has to tap on the App Feedback text a couple of times before they can reveal what the actual email address, see second image.

    screen grab of formatted email string screen grab of revealed email string

提交回复
热议问题