Every developer must have had at least one email that goes something like this: “I opened the app and it did not work”. For emails like that there is not much you can do but be patient and try to figure out exactly what the problem was. For other emails though it may sometimes be good to know a little about the device that the person was having the problem with. For example “The GPS says it is not working so therefore your app is junk” could be put into context by seeing that the email was sent from an iPod Touch (which does not have a GPS chip). Also, information about the version of iOS helps with locating what the issue may be. Finally it can be very useful to know which version of your app the person is using since they may be having a problem with an old version of the app where the problem may have been fixed in the latest version.
MFMailComposeViewController *mail = [[MFMailComposeViewController alloc] init];
mail.mailComposeDelegate = self;
if ([MFMailComposeViewController canSendMail]) {
//Setting up the Subject, recipients, and message body.
[mail setToRecipients:[NSArray arrayWithObjects:@"YOUREMAIL.com",nil]];
[mail setSubject: [NSString stringWithFormat:@"%@ iPhone Application Feedback", kTWApplicationName]];
[mail setMessageBody:[NSString stringWithFormat:@"\n\n\nIn order for us to better help you, please provide the following information:\nCountry: \n\nDebug info:\n%@ v %@\niOS version %@\nModel: %@",
kTWApplicationName,
[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"],
[[UIDevice currentDevice] systemVersion],
[[UIDevice currentDevice] model]
] isHTML:NO];
//Present the mail view controller
[self presentModalViewController:mail animated:YES];
}
//release the mail
[mail release];
The TWApplicationName is a constant that is set to the string value of the application name – this allows you to also see which application your user is asking about in case you have more than one app.