If quincy.bundle is missing in the app, show a warning via NSLog and send crash reports without showing any dialogs, since it would crash otherwise

This commit is contained in:
Andreas Linde 2011-12-04 13:56:27 +01:00
parent 9415d921b6
commit dc631f4d7e

View File

@ -179,6 +179,10 @@ NSString *BWQuincyLocalize(NSString *stringToken) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(startManager) name:BWQuincyNetworkBecomeReachable object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(startManager) name:BWQuincyNetworkBecomeReachable object:nil];
} }
if (!quincyBundle()) {
NSLog(@"WARNING: Quincy.bundle is missing in the app bundle!");
}
} }
return self; return self;
} }
@ -251,7 +255,10 @@ NSString *BWQuincyLocalize(NSString *stringToken) {
- (void)startManager { - (void)startManager {
if (!_sendingInProgress && [self hasPendingCrashReport]) { if (!_sendingInProgress && [self hasPendingCrashReport]) {
_sendingInProgress = YES; _sendingInProgress = YES;
if (!self.autoSubmitCrashReport && [self hasNonApprovedCrashReports]) { if (!quincyBundle()) {
NSLog(@"Quincy.bundle is missing, sending report automatically!");
[self _sendCrashReports];
} else if (!self.autoSubmitCrashReport && [self hasNonApprovedCrashReports]) {
if (self.delegate != nil && [self.delegate respondsToSelector:@selector(willShowSubmitCrashReportAlert)]) { if (self.delegate != nil && [self.delegate respondsToSelector:@selector(willShowSubmitCrashReportAlert)]) {
[self.delegate willShowSubmitCrashReportAlert]; [self.delegate willShowSubmitCrashReportAlert];
@ -323,7 +330,8 @@ NSString *BWQuincyLocalize(NSString *stringToken) {
UIAlertView *alertView = nil; UIAlertView *alertView = nil;
if (_serverResult >= CrashReportStatusAssigned && if (_serverResult >= CrashReportStatusAssigned &&
_crashIdenticalCurrentVersion) { _crashIdenticalCurrentVersion &&
quincyBundle()) {
// show some feedback to the user about the crash status // show some feedback to the user about the crash status
NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]; NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
switch (_serverResult) { switch (_serverResult) {
@ -459,7 +467,7 @@ NSString *BWQuincyLocalize(NSString *stringToken) {
NSString *contact = @""; NSString *contact = @"";
NSString *description = @""; NSString *description = @"";
if (self.autoSubmitDeviceUDID) { if (self.autoSubmitDeviceUDID && [[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"]) {
userid = [self deviceIdentifier]; userid = [self deviceIdentifier];
} else if (self.delegate != nil && [self.delegate respondsToSelector:@selector(crashReportUserID)]) { } else if (self.delegate != nil && [self.delegate respondsToSelector:@selector(crashReportUserID)]) {
userid = [self.delegate crashReportUserID] ?: @""; userid = [self.delegate crashReportUserID] ?: @"";