I recently submitted an app to Apple and sadly it was rejected. The reason given was that it has an email to friend feature that wasn’t working. (Needless to say, but it works great on my device). I’m using an MFMailComposeViewController, filling in the subject and body and adding an attachment. The user then must take the rest of the action to send. When I asked for elaboration the reviewer said…
The Emails we have sent with your app are listed in the Gmail, and Yahoo, test accounts “outbox,” with an error stating the outgoing mail server could not be reached.
…should this count as an error with my app? I don’t actually send the mail, I just use the built in SDK calls to prepare a message. I know an argument of “it’s your device” won’t really advance me towards getting my app approved but I really think it’s their device.
Can anyone think of any reasons an email would fail with a message like this and of those reasons, anything I could actually do about it?
And now my code…
…where I send the message
- (void)sendMail
{
NSData *vCards = (NSData *)ABPersonCreateVCardRepresentationWithPeople((CFArrayRef)self.selections);
MFMailComposeViewController *mc = [[MFMailComposeViewController alloc] init];
mc.mailComposeDelegate = self;
[mc setSubject:@"Contact"];
[mc setMessageBody:@"<p>My message...<p>" isHTML:YES];
NSString *label = ([self.selections count] == 1)? (NSString *)ABRecordCopyCompositeName([self.selections objectAtIndex:0]): @"Contacts";
[mc addAttachmentData:vCards mimeType:@"text/x-vcard" fileName:label];
[self presentModalViewController:mc animated:YES];
[mc release];
}
- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error {
switch (result) {
case MFMailComposeResultCancelled:
NSLog(@"Mail send canceled.");
break;
case MFMailComposeResultSaved:
NSLog(@"Mail saved.");
break;
case MFMailComposeResultSent:
NSLog(@"Mail sent.");
break;
case MFMailComposeResultFailed:
NSLog(@"Mail send error: %@.", [error localizedDescription]);
break;
default:
break;
}
[self dismissModalViewControllerAnimated:YES];
}
Now I understand that I’m not actually doing anything useful if the message fails, but should the message even be getting to the user’s outbox if it fails at the compose level?
I’m going to submit another version alerting the error details, but I doubt there will be any.
Last night on my iPhone I got notifications from the iTunesConnect that my app was In Review > Waiting For Review > Processing for App Store > Ready For Sale, all in rapid succession. The Resolution Center has no further notes and I received no other emails from Apple about the issue. I’m happy it all go worked out, but still have a lingering doubt that some edge case bug is going to one-star me to death. Sorry the resolution is so boring.
Here’s my app in the store: http://itunes.apple.com/us/app/cloner/id483981001?mt=8 (plug). Thanks to everyone for the great suggestions.