在我的應用程序,我有一個日誌機制,它提供的可能性,以客戶通過mail.For這個發送日誌,我綜合我的應用程序的蘋果MFMailComposeViewController。如果客戶使用低操作系統版本(2.x)的設備或電子郵件帳戶沒有出現在設備上,我推送了一些UIAlertsView給用戶一些提示性消息。有人可以看看我的下面的代碼,並回答是否有什麼可能導致蘋果拒絕?MFMailComposeViewController使用和蘋果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];
非常感謝,
亞歷克斯。
謝謝,弗拉基米爾。我沒有想到這個 - 確實會崩潰:)。 – 2010-10-22 12:28:15