objective c - Unable to send email in iOS app IN Xcode 8 -
- (ibaction)showemail:(id)sender { if ([mfmailcomposeviewcontroller cansendmail]) { mfmailcomposeviewcontroller* composevc = [[mfmailcomposeviewcontroller alloc] init]; composevc.mailcomposedelegate = self; // configure fields of interface. [composevc settorecipients:@[@"address@example.com"]]; [composevc setsubject:@"hello!"]; [composevc setmessagebody:@"hello california!" ishtml:no]; // present view controller modally. [self presentviewcontroller:composevc animated:yes completion:nil]; // composevc.modalpresentationstyle = uimodalpresentationpagesheet ; } else{ uialertview *alert = [[uialertview alloc] initwithtitle:@"failure" message:@"your device doesn't support composer sheet" delegate:nil cancelbuttontitle:@"ok" otherbuttontitles: nil]; [alert show]; } } it goes in else condition when tested on real device. please help. works in other xcode versions
Comments
Post a Comment