Created
March 12, 2014 17:41
-
-
Save kharmabum/9512144 to your computer and use it in GitHub Desktop.
Get feedback from user w/ bundle version id
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
} 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