Skip to content

Instantly share code, notes, and snippets.

@kharmabum
Created March 12, 2014 17:41
Show Gist options
  • Save kharmabum/9512144 to your computer and use it in GitHub Desktop.
Save kharmabum/9512144 to your computer and use it in GitHub Desktop.
Get feedback from user w/ bundle version id
} else if ([choice isEqualToString:@"Feedback"]) {
if ([MFMailComposeViewController canSendMail])
{
MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init];
mailer.mailComposeDelegate = self;
[mailer setSubject:@"[Hopp2IT] Feedback"];
NSString * version = [[NSBundle mainBundle] objectForInfoDictionaryKey: @"CFBundleShortVersionString"];
NSString *device = ([HPManager isiPhone5]) ? @"iPhone5" : @"<=iPhone4";
NSString *messageBody = [NSString stringWithFormat:@"\n\n~~~~~~~~~~~~~~\nPlatform: iOS\nDevice: %@\nVersion: %@\n",device,version];
[mailer setMessageBody:messageBody isHTML:NO];
[mailer setToRecipients:[NSArray arrayWithObject:@"[email protected]"]];
UINavigationController *nc = (UINavigationController*)self.viewDeckController.centerController;
[self performBlockOnMainThread:^{
[nc presentModalViewController:mailer animated:YES];
} afterDelay:0.33];
}
else {
UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"Not Supported" message:@"Your device is not capable of sending an email." delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles: nil];
[av show];
}
return;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment