В моем приложении у меня есть механизм журналов, который дает возможность клиенту отправлять журналы через почту. Для этого я включил в свое приложение Apple MFMailComposeViewController. В случае, если клиент использует устройство с низкой версией ОС (2.x) или учетной записью электронной почты на устройстве, я нажал несколько UIAlertsView с некоторыми наводящими сообщениями для пользователей. Может кто-нибудь, пожалуйста, взгляните на мой ниже код и ответьте, если есть что-то, что может привести к отказу Apple?Использование MFMailComposeViewController и процесс Apple aproval
BOOL canSendmail = [MFMailComposeViewController canSendMail];
if (!canSendmail) {
NSMutableString* osVersion = [NSMutableString stringWithString:[[UIDevice currentDevice] systemVersion]];
EventsLog* logs = [EventsLog getInstance];
if ([osVersion characterAtIndex : 0] == '2' || [osVersion characterAtIndex : 0] == '1') {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Email", @"")
message:NSLocalizedString(@"Failed to send E-mail.For this service you need to upgrade the iPhone OS to 3.0 version or later", @"")
delegate:self cancelButtonTitle:NSLocalizedString(@"OK", @"") otherButtonTitles: nil];
[alert show];
[alert release];
[logs writeEvent : @"Cannot send e-mail - iPhone OS needs upgrade to at least 3.0 version" classSource:@"[email protected]" details : (@" device OS version is %@",osVersion)];
return;
}
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Email", @"")
message:NSLocalizedString(@"Failed to send E-mail.Please set an E-mail account and try again", @"")
delegate:self cancelButtonTitle:NSLocalizedString(@"OK", @"") otherButtonTitles: nil];
[alert show];
[alert release];
[logs writeEvent : @"Cannot send e-mail "
classSource:@"[email protected]" details : @"- no e-mail account activated"];
return;
}
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Email", @"")
message:NSLocalizedString(@"The data you are sending will be used to improve the application. You are free to add any personal comments in this e-mail", @"")
delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", @"") otherButtonTitles: nil];
[alert addButtonWithTitle:NSLocalizedString(@"Submit", @"")];
[alert show];
[alert release];
Большое спасибо,
Alex.
Спасибо, Владимир. Я не думал об этом - в самом деле, это сбой :). –