Clean up some more naming and disable logging in App Store

- Change last BITHockeySDK.. into BITHockey…
- Disable BITHockeyLog when running in an App Store build
This commit is contained in:
Andreas Linde 2012-07-21 22:58:40 +02:00
parent e75eef7136
commit 812d0b4a35
13 changed files with 102 additions and 102 deletions

View File

@ -140,7 +140,7 @@
- (NSString *)versionString {
NSString *shortString = ([self.shortVersion respondsToSelector:@selector(length)] && [self.shortVersion length]) ? [NSString stringWithFormat:@"%@", self.shortVersion] : @"";
NSString *versionString = [shortString length] ? [NSString stringWithFormat:@" (%@)", self.version] : self.version;
return [NSString stringWithFormat:@"%@ %@%@", BITHockeySDKLocalizedString(@"UpdateVersion"), shortString, versionString];
return [NSString stringWithFormat:@"%@ %@%@", BITHockeyLocalizedString(@"UpdateVersion"), shortString, versionString];
}
- (NSString *)dateString {

View File

@ -72,7 +72,7 @@
- (id)initWithAppIdentifier:(NSString *)appIdentifier {
if ((self = [super init])) {
BITHockeySDKLog(@"Initializing CrashReporter");
BITHockeyLog(@"Initializing CrashReporter");
_appIdentifier = appIdentifier;
@ -136,7 +136,7 @@
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(startManager) name:BITHockeyNetworkDidBecomeReachableNotification object:nil];
}
if (!BITHockeySDKBundle()) {
if (!BITHockeyBundle()) {
NSLog(@"WARNING: %@.bundle is missing, will send reports automatically!", BITHOCKEYSDK_BUNDLE);
}
}
@ -187,7 +187,7 @@
- (void)startManager {
if (!_sendingInProgress && [self hasPendingCrashReport]) {
_sendingInProgress = YES;
if (!BITHockeySDKBundle()) {
if (!BITHockeyBundle()) {
NSLog(@"WARNING: HockeySDKResource.bundle is missing, sending reports automatically!");
[self sendCrashReports];
} else if (![self autoSendCrashReports] && [self hasNonApprovedCrashReports]) {
@ -198,14 +198,14 @@
NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:BITHockeySDKLocalizedString(@"CrashDataFoundTitle"), appName]
message:[NSString stringWithFormat:BITHockeySDKLocalizedString(@"CrashDataFoundDescription"), appName]
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:BITHockeyLocalizedString(@"CrashDataFoundTitle"), appName]
message:[NSString stringWithFormat:BITHockeyLocalizedString(@"CrashDataFoundDescription"), appName]
delegate:self
cancelButtonTitle:BITHockeySDKLocalizedString(@"CrashDontSendReport")
otherButtonTitles:BITHockeySDKLocalizedString(@"CrashSendReport"), nil];
cancelButtonTitle:BITHockeyLocalizedString(@"CrashDontSendReport")
otherButtonTitles:BITHockeyLocalizedString(@"CrashSendReport"), nil];
if ([self isShowingAlwaysButton]) {
[alertView addButtonWithTitle:BITHockeySDKLocalizedString(@"CrashSendReportAlways")];
[alertView addButtonWithTitle:BITHockeyLocalizedString(@"CrashSendReportAlways")];
}
[alertView setTag: BITCrashAlertTypeSend];
@ -294,7 +294,7 @@
}
if ([_crashFiles count] > 0) {
BITHockeySDKLog(@"Pending crash reports found.");
BITHockeyLog(@"Pending crash reports found.");
return YES;
} else
return NO;
@ -308,29 +308,29 @@
if (_serverResult >= BITCrashStatusAssigned &&
_crashIdenticalCurrentVersion &&
BITHockeySDKBundle()) {
BITHockeyBundle()) {
// show some feedback to the user about the crash status
NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"];
switch (_serverResult) {
case BITCrashStatusAssigned:
alertView = [[UIAlertView alloc] initWithTitle: [NSString stringWithFormat:BITHockeySDKLocalizedString(@"CrashResponseTitle"), appName ]
message: [NSString stringWithFormat:BITHockeySDKLocalizedString(@"CrashResponseNextRelease"), appName]
alertView = [[UIAlertView alloc] initWithTitle: [NSString stringWithFormat:BITHockeyLocalizedString(@"CrashResponseTitle"), appName ]
message: [NSString stringWithFormat:BITHockeyLocalizedString(@"CrashResponseNextRelease"), appName]
delegate: self
cancelButtonTitle: BITHockeySDKLocalizedString(@"HockeyOK")
cancelButtonTitle: BITHockeyLocalizedString(@"HockeyOK")
otherButtonTitles: nil];
break;
case BITCrashStatusSubmitted:
alertView = [[UIAlertView alloc] initWithTitle: [NSString stringWithFormat:BITHockeySDKLocalizedString(@"CrashResponseTitle"), appName ]
message: [NSString stringWithFormat:BITHockeySDKLocalizedString(@"CrashResponseWaitingApple"), appName]
alertView = [[UIAlertView alloc] initWithTitle: [NSString stringWithFormat:BITHockeyLocalizedString(@"CrashResponseTitle"), appName ]
message: [NSString stringWithFormat:BITHockeyLocalizedString(@"CrashResponseWaitingApple"), appName]
delegate: self
cancelButtonTitle: BITHockeySDKLocalizedString(@"HockeyOK")
cancelButtonTitle: BITHockeyLocalizedString(@"HockeyOK")
otherButtonTitles: nil];
break;
case BITCrashStatusAvailable:
alertView = [[UIAlertView alloc] initWithTitle: [NSString stringWithFormat:BITHockeySDKLocalizedString(@"CrashResponseTitle"), appName ]
message: [NSString stringWithFormat:BITHockeySDKLocalizedString(@"CrashResponseAvailable"), appName]
alertView = [[UIAlertView alloc] initWithTitle: [NSString stringWithFormat:BITHockeyLocalizedString(@"CrashResponseTitle"), appName ]
message: [NSString stringWithFormat:BITHockeyLocalizedString(@"CrashResponseAvailable"), appName]
delegate: self
cancelButtonTitle: BITHockeySDKLocalizedString(@"HockeyOK")
cancelButtonTitle: BITHockeyLocalizedString(@"HockeyOK")
otherButtonTitles: nil];
break;
default:
@ -479,7 +479,7 @@
[[NSUserDefaults standardUserDefaults] synchronize];
if (crashes != nil) {
BITHockeySDKLog(@"Sending crash reports:\n%@", crashes);
BITHockeyLog(@"Sending crash reports:\n%@", crashes);
[self postXML:[NSString stringWithFormat:@"<crashes>%@</crashes>", crashes]
toURL:[NSURL URLWithString:BITHOCKEYSDK_URL]];
@ -529,9 +529,9 @@
_urlConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
if (!_urlConnection) {
BITHockeySDKLog(@"Requesting feedback status could not start!");
BITHockeyLog(@"Requesting feedback status could not start!");
} else {
BITHockeySDKLog(@"Requesting feedback status.");
BITHockeyLog(@"Requesting feedback status.");
}
}
@ -581,14 +581,14 @@
_urlConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
if (!_urlConnection) {
BITHockeySDKLog(@"Sending crash reports could not start!");
BITHockeyLog(@"Sending crash reports could not start!");
_sendingInProgress = NO;
} else {
if (self.delegate != nil && [self.delegate respondsToSelector:@selector(crashReporterWillSendCrashReport:)]) {
[self.delegate crashReporterWillSendCrashReport:self];
}
BITHockeySDKLog(@"Sending crash reports started.");
BITHockeyLog(@"Sending crash reports started.");
}
}
@ -609,7 +609,7 @@
[self.delegate crashReporter:self didFailWithError:error];
}
BITHockeySDKLog(@"ERROR: %@", [error localizedDescription]);
BITHockeyLog(@"ERROR: %@", [error localizedDescription]);
_sendingInProgress = NO;
@ -631,7 +631,7 @@
mutabilityOption:NSPropertyListMutableContainersAndLeaves
format:nil
errorDescription:NULL];
BITHockeySDKLog(@"Received API response: %@", response);
BITHockeyLog(@"Received API response: %@", response);
_serverResult = (BITCrashStatus)[[response objectForKey:@"status"] intValue];
if ([response objectForKey:@"id"]) {
@ -668,7 +668,7 @@
[self.delegate crashReporter:self didFailWithError:error];
}
BITHockeySDKLog(@"ERROR: %@", [error localizedDescription]);
BITHockeyLog(@"ERROR: %@", [error localizedDescription]);
} else {
if (_responseData == nil || [_responseData length] == 0) {
error = [NSError errorWithDomain:kBITCrashErrorDomain
@ -684,7 +684,7 @@
[self.delegate crashReporter:self didFailWithError:error];
}
BITHockeySDKLog(@"ERROR: %@", [error localizedDescription]);
BITHockeyLog(@"ERROR: %@", [error localizedDescription]);
}
_sendingInProgress = NO;

View File

@ -33,6 +33,7 @@
@protocol BITHockeyManagerDelegate;
@class BITCrashManager;
@class BITUpdateManager;
@interface BITHockeyManager : NSObject {
@private

View File

@ -110,15 +110,15 @@
- (void)startManager {
BITHockeySDKLog(@"Starting HockeyManager");
BITHockeyLog(@"Starting HockeyManager");
_startManagerIsInvoked = YES;
// start CrashManager
BITHockeySDKLog(@"Start crashManager");
BITHockeyLog(@"Start crashManager");
[_crashManager performSelector:@selector(startManager) withObject:nil afterDelay:1.0f];
// Setup UpdateManager
BITHockeySDKLog(@"Start UpdateManager");
BITHockeyLog(@"Start UpdateManager");
[_updateManager performSelector:@selector(startManager) withObject:nil afterDelay:0.0f];
}
@ -162,15 +162,15 @@
_startManagerIsInvoked = NO;
if (_validAppIdentifier) {
BITHockeySDKLog(@"Setup CrashManager");
BITHockeyLog(@"Setup CrashManager");
self.crashManager = [[[BITCrashManager alloc] initWithAppIdentifier:_appIdentifier] autorelease];
BITHockeySDKLog(@"Setup UpdateManager");
BITHockeyLog(@"Setup UpdateManager");
self.updateManager = [[[BITUpdateManager alloc] initWithAppIdentifier:_appIdentifier isAppStoreEnvironemt:_isAppStoreEnvironment] autorelease];
// Only if JMC is part of the project
if ([[self class] isJMCPresent]) {
BITHockeySDKLog(@"Setup JMC");
BITHockeyLog(@"Setup JMC");
[_updateManager setCheckForTracker:YES];
[_updateManager addObserver:self forKeyPath:@"trackerConfig" options:0 context:nil];
[[self class] disableJMCCrashReporter];

View File

@ -111,15 +111,15 @@
#pragma mark - private
- (void)reportError:(NSError *)error {
BITHockeySDKLog(@"Error: %@", [error localizedDescription]);
BITHockeyLog(@"Error: %@", [error localizedDescription]);
_lastCheckFailed = YES;
// only show error if we enable that
if (_showFeedback) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:BITHockeySDKLocalizedString(@"UpdateError")
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:BITHockeyLocalizedString(@"UpdateError")
message:[error localizedDescription]
delegate:nil
cancelButtonTitle:BITHockeySDKLocalizedString(@"OK") otherButtonTitles:nil];
cancelButtonTitle:BITHockeyLocalizedString(@"OK") otherButtonTitles:nil];
[alert show];
[alert release];
_showFeedback = NO;
@ -222,7 +222,7 @@
}
- (NSString *)authenticationToken {
return [BITHockeySDKMD5([NSString stringWithFormat:@"%@%@%@%@",
return [BITHockeyMD5([NSString stringWithFormat:@"%@%@%@%@",
_authenticationSecret,
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"],
[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleIdentifier"],
@ -289,7 +289,7 @@
if ([UIWindow instancesRespondToSelector:@selector(rootViewController)]) {
if ([window rootViewController]) {
visibleWindow = window;
BITHockeySDKLog(@"UIWindow with rootViewController found: %@", visibleWindow);
BITHockeyLog(@"UIWindow with rootViewController found: %@", visibleWindow);
break;
}
}
@ -386,7 +386,7 @@
self.userAllowsSendUsageTime = YES;
}
if (!BITHockeySDKBundle()) {
if (!BITHockeyBundle()) {
NSLog(@"WARNING: %@.bundle is missing, make sure it is added!", BITHOCKEYSDK_BUNDLE);
}
@ -442,7 +442,7 @@
}
if (_currentHockeyViewController) {
BITHockeySDKLog(@"update view already visible, aborting");
BITHockeyLog(@"update view already visible, aborting");
return;
}
@ -503,24 +503,24 @@
if (!_updateAlertShowing) {
if ([self hasNewerMandatoryVersion]) {
UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:BITHockeySDKLocalizedString(@"UpdateAvailable")
message:[NSString stringWithFormat:BITHockeySDKLocalizedString(@"UpdateAlertMandatoryTextWithAppVersion"), [self.newestAppVersion nameAndVersionString]]
UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:BITHockeyLocalizedString(@"UpdateAvailable")
message:[NSString stringWithFormat:BITHockeyLocalizedString(@"UpdateAlertMandatoryTextWithAppVersion"), [self.newestAppVersion nameAndVersionString]]
delegate:self
cancelButtonTitle:BITHockeySDKLocalizedString(@"UpdateInstall")
cancelButtonTitle:BITHockeyLocalizedString(@"UpdateInstall")
otherButtonTitles:nil
] autorelease];
[alertView setTag:2];
[alertView show];
_updateAlertShowing = YES;
} else {
UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:BITHockeySDKLocalizedString(@"UpdateAvailable")
message:[NSString stringWithFormat:BITHockeySDKLocalizedString(@"UpdateAlertTextWithAppVersion"), [self.newestAppVersion nameAndVersionString]]
UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:BITHockeyLocalizedString(@"UpdateAvailable")
message:[NSString stringWithFormat:BITHockeyLocalizedString(@"UpdateAlertTextWithAppVersion"), [self.newestAppVersion nameAndVersionString]]
delegate:self
cancelButtonTitle:BITHockeySDKLocalizedString(@"UpdateIgnore")
otherButtonTitles:BITHockeySDKLocalizedString(@"UpdateShow"), nil
cancelButtonTitle:BITHockeyLocalizedString(@"UpdateIgnore")
otherButtonTitles:BITHockeyLocalizedString(@"UpdateShow"), nil
] autorelease];
if (self.isShowingDirectInstallOption) {
[alertView addButtonWithTitle:BITHockeySDKLocalizedString(@"UpdateInstall")];
[alertView addButtonWithTitle:BITHockeyLocalizedString(@"UpdateInstall")];
}
[alertView setTag:0];
[alertView show];
@ -704,7 +704,7 @@
// build request & send
NSString *url = [NSString stringWithFormat:@"%@%@", BITHOCKEYSDK_URL, parameter];
BITHockeySDKLog(@"sending api request to %@", url);
BITHockeyLog(@"sending api request to %@", url);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:1 timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
@ -728,7 +728,7 @@
userInfo:[NSDictionary dictionaryWithObjectsAndKeys:@"Server returned empty response.", NSLocalizedDescriptionKey, nil]]];
return;
} else {
BITHockeySDKLog(@"Received API response: %@", responseString);
BITHockeyLog(@"Received API response: %@", responseString);
NSString *token = [[feedDict objectForKey:@"authcode"] lowercaseString];
failed = NO;
if ([[self authenticationToken] compare:token] == NSOrderedSame) {
@ -748,21 +748,21 @@
}
} else {
// different token, block this version
BITHockeySDKLog(@"AUTH FAILURE: %@", [self authenticationToken]);
BITHockeyLog(@"AUTH FAILURE: %@", [self authenticationToken]);
// store the new data
[[NSUserDefaults standardUserDefaults] setObject:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"] forKey:kBITUpdateAuthorizedVersion];
[[NSUserDefaults standardUserDefaults] setObject:token forKey:kBITUpdateAuthorizedVersion];
[[NSUserDefaults standardUserDefaults] synchronize];
[self showAuthorizationScreen:BITHockeySDKLocalizedString(@"UpdateAuthorizationDenied") image:@"authorize_denied.png"];
[self showAuthorizationScreen:BITHockeyLocalizedString(@"UpdateAuthorizationDenied") image:@"authorize_denied.png"];
}
}
}
if (failed) {
[self showAuthorizationScreen:BITHockeySDKLocalizedString(@"UpdateAuthorizationOffline") image:@"authorize_request.png"];
[self showAuthorizationScreen:BITHockeyLocalizedString(@"UpdateAuthorizationOffline") image:@"authorize_request.png"];
}
}
@ -784,7 +784,7 @@
// do we need to update?
if (![self shouldCheckForUpdates] && !_currentHockeyViewController) {
BITHockeySDKLog(@"update not needed right now");
BITHockeyLog(@"update not needed right now");
self.checkInProgress = NO;
return;
}
@ -818,7 +818,7 @@
// build request & send
NSString *url = [NSString stringWithFormat:@"%@%@", BITHOCKEYSDK_URL, parameter];
BITHockeySDKLog(@"sending api request to %@", url);
BITHockeyLog(@"sending api request to %@", url);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:1 timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
@ -838,12 +838,12 @@
if (_isAppStoreEnvironment) return NO;
if (!self.isUpdateAvailable) {
BITHockeySDKLog(@"Warning: No update available. Aborting.");
BITHockeyLog(@"Warning: No update available. Aborting.");
return NO;
}
#if TARGET_IPHONE_SIMULATOR
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:hockeySDKLocalizedString(@"UpdateWarning") message:hockeySDKLocalizedString(@"UpdateSimulatorMessage") delegate:nil cancelButtonTitle:hockeySDKLocalizedString(@"HockeyOK") otherButtonTitles:nil] autorelease];
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:BITHockeyLocalizedString(@"UpdateWarning") message:BITHockeyLocalizedString(@"UpdateSimulatorMessage") delegate:nil cancelButtonTitle:BITHockeyLocalizedString(@"HockeyOK") otherButtonTitles:nil] autorelease];
[alert show];
return NO;
#endif
@ -856,9 +856,9 @@
NSString *hockeyAPIURL = [NSString stringWithFormat:@"%@api/2/apps/%@?format=plist%@", BITHOCKEYSDK_URL, [self encodedAppIdentifier], extraParameter];
NSString *iOSUpdateURL = [NSString stringWithFormat:@"itms-services://?action=download-manifest&url=%@", [hockeyAPIURL bit_URLEncodedString]];
BITHockeySDKLog(@"API Server Call: %@, calling iOS with %@", hockeyAPIURL, iOSUpdateURL);
BITHockeyLog(@"API Server Call: %@, calling iOS with %@", hockeyAPIURL, iOSUpdateURL);
BOOL success = [[UIApplication sharedApplication] openURL:[NSURL URLWithString:iOSUpdateURL]];
BITHockeySDKLog(@"System returned: %d", success);
BITHockeyLog(@"System returned: %d", success);
return success;
}
@ -880,7 +880,7 @@
BITUpdateAuthorizationState state = [self authorizationState];
if (state == BITUpdateAuthorizationDenied) {
[self showAuthorizationScreen:BITHockeySDKLocalizedString(@"UpdateAuthorizationDenied") image:@"authorize_denied.png"];
[self showAuthorizationScreen:BITHockeyLocalizedString(@"UpdateAuthorizationDenied") image:@"authorize_denied.png"];
} else if (state == BITUpdateAuthorizationAllowed) {
self.requireAuthorization = NO;
return YES;
@ -894,7 +894,7 @@
- (void)startManager {
if (![self appVersionIsAuthorized]) {
if ([self authorizationState] == BITUpdateAuthorizationPending) {
[self showAuthorizationScreen:BITHockeySDKLocalizedString(@"UpdateAuthorizationProgress") image:@"authorize_request.png"];
[self showAuthorizationScreen:BITHockeyLocalizedString(@"UpdateAuthorizationProgress") image:@"authorize_request.png"];
[self performSelector:@selector(checkForAuthorization) withObject:nil afterDelay:0.0f];
}
@ -950,7 +950,7 @@
if ([self.receivedData length]) {
NSString *responseString = [[[NSString alloc] initWithBytes:[_receivedData bytes] length:[_receivedData length] encoding: NSUTF8StringEncoding] autorelease];
BITHockeySDKLog(@"Received API response: %@", responseString);
BITHockeyLog(@"Received API response: %@", responseString);
id json = [self parseJSONResultString:responseString];
self.trackerConfig = (([self checkForTracker] && [[json valueForKey:@"tracker"] isKindOfClass:[NSDictionary class]]) ? [json valueForKey:@"tracker"] : nil);
@ -1005,12 +1005,12 @@
NSString *shortVersionString = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
shortVersionString = shortVersionString ? [NSString stringWithFormat:@"%@ ", shortVersionString] : @"";
versionString = [shortVersionString length] ? [NSString stringWithFormat:@"(%@)", versionString] : versionString;
NSString *currentVersionString = [NSString stringWithFormat:@"%@ %@ %@%@", self.newestAppVersion.name, BITHockeySDKLocalizedString(@"UpdateVersion"), shortVersionString, versionString];
NSString *alertMsg = [NSString stringWithFormat:BITHockeySDKLocalizedString(@"UpdateNoUpdateAvailableMessage"), currentVersionString];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:BITHockeySDKLocalizedString(@"UpdateNoUpdateAvailableTitle")
NSString *currentVersionString = [NSString stringWithFormat:@"%@ %@ %@%@", self.newestAppVersion.name, BITHockeyLocalizedString(@"UpdateVersion"), shortVersionString, versionString];
NSString *alertMsg = [NSString stringWithFormat:BITHockeyLocalizedString(@"UpdateNoUpdateAvailableMessage"), currentVersionString];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:BITHockeyLocalizedString(@"UpdateNoUpdateAvailableTitle")
message:alertMsg
delegate:nil
cancelButtonTitle:BITHockeySDKLocalizedString(@"HockeyOK")
cancelButtonTitle:BITHockeyLocalizedString(@"HockeyOK")
otherButtonTitles:nil];
[alert show];
[alert release];

View File

@ -48,7 +48,7 @@
- (id)init:(BITUpdateManager *)newUpdateManager {
if ((self = [super init])) {
self.updateManager = newUpdateManager;
self.title = BITHockeySDKLocalizedString(@"UpdateSettingsTitle");
self.title = BITHockeyLocalizedString(@"UpdateSettingsTitle");
CGRect frame = self.view.frame;
frame.origin = CGPointZero;
@ -95,7 +95,7 @@
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
if (section == [self numberOfSections] - 1) {
return BITHockeySDKLocalizedString(@"UpdateSectionCheckTitle");
return BITHockeyLocalizedString(@"UpdateSectionCheckTitle");
} else {
return nil;
}
@ -120,9 +120,9 @@
footer.font = [UIFont systemFontOfSize:13];
if (section == 0 && [_updateManager isAllowUserToDisableSendData] && [_updateManager shouldSendUserData]) {
footer.text = BITHockeySDKLocalizedString(@"UpdateSettingsUserDataDescription");
footer.text = BITHockeyLocalizedString(@"UpdateSettingsUserDataDescription");
} else if ([_updateManager isAllowUserToDisableSendData] && section < [self numberOfSections]) {
footer.text = BITHockeySDKLocalizedString(@"UpdateSettingsUsageDataDescription");
footer.text = BITHockeyLocalizedString(@"UpdateSettingsUsageDataDescription");
}
UIView* view = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 285, footer.frame.size.height + 6 + 11)] autorelease];
@ -201,19 +201,19 @@
BITUpdateSetting hockeyAutoUpdateSetting = [_updateManager updateSetting];
if (indexPath.row == 0) {
// on startup
cell.textLabel.text = BITHockeySDKLocalizedString(@"UpdateSectionCheckStartup");
cell.textLabel.text = BITHockeyLocalizedString(@"UpdateSectionCheckStartup");
if (hockeyAutoUpdateSetting == BITUpdateCheckStartup) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
}
} else if (indexPath.row == 1) {
// daily
cell.textLabel.text = BITHockeySDKLocalizedString(@"UpdateSectionCheckDaily");
cell.textLabel.text = BITHockeyLocalizedString(@"UpdateSectionCheckDaily");
if (hockeyAutoUpdateSetting == BITUpdateCheckDaily) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
}
} else {
// manually
cell.textLabel.text = BITHockeySDKLocalizedString(@"UpdateSectionCheckManually");
cell.textLabel.text = BITHockeyLocalizedString(@"UpdateSectionCheckManually");
if (hockeyAutoUpdateSetting == BITUpdateCheckManually) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
}
@ -223,14 +223,14 @@
if (indexPath.section == 0 && [_updateManager shouldSendUserData] && [_updateManager isAllowUserToDisableSendData]) {
// send user data
cell.textLabel.text = BITHockeySDKLocalizedString(@"UpdateSettingsUserData");
cell.textLabel.text = BITHockeyLocalizedString(@"UpdateSettingsUserData");
[toggleSwitch addTarget:self action:@selector(sendUserData:)
forControlEvents:UIControlEventValueChanged];
[toggleSwitch setOn:[_updateManager doesUserAllowsSendUserData]];
} else if ([_updateManager shouldSendUsageTime] && [_updateManager isAllowUserToDisableSendData]) {
// send usage time
cell.textLabel.text = BITHockeySDKLocalizedString(@"UpdateSettingsUsageData");
cell.textLabel.text = BITHockeyLocalizedString(@"UpdateSettingsUsageData");
[toggleSwitch addTarget:self action:@selector(sendUsageData:)
forControlEvents:UIControlEventValueChanged];
[toggleSwitch setOn:[_updateManager doesUserAllowsSendUsageTime]];

View File

@ -179,7 +179,7 @@
footerButton.layer.shadowColor = [[UIColor blackColor] CGColor];
footerButton.layer.shadowRadius = 2.0f;
footerButton.titleLabel.font = [UIFont boldSystemFontOfSize:14];
[footerButton setTitle:BITHockeySDKLocalizedString(@"UpdateShowPreviousVersions") forState:UIControlStateNormal];
[footerButton setTitle:BITHockeyLocalizedString(@"UpdateShowPreviousVersions") forState:UIControlStateNormal];
[footerButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[footerButton setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted];
[footerButton setBackgroundImage:[UIImage bit_imageNamed:@"buttonHighlight.png" bundle:BITHOCKEYSDK_BUNDLE] forState:UIControlStateHighlighted];
@ -201,7 +201,7 @@
// create web view for a version
NSString *installed = @"";
if ([appVersion.version isEqualToString:[_updateManager currentAppVersion]]) {
installed = [NSString stringWithFormat:@"<span style=\"float:%@;text-shadow:rgba(255,255,255,0.6) 1px 1px 0px;\"><b>%@</b></span>", [appVersion isEqual:_updateManager.newestAppVersion] ? @"left" : @"right", BITHockeySDKLocalizedString(@"UpdateInstalled")];
installed = [NSString stringWithFormat:@"<span style=\"float:%@;text-shadow:rgba(255,255,255,0.6) 1px 1px 0px;\"><b>%@</b></span>", [appVersion isEqual:_updateManager.newestAppVersion] ? @"left" : @"right", BITHockeyLocalizedString(@"UpdateInstalled")];
}
if ([appVersion isEqual:_updateManager.newestAppVersion]) {
@ -209,7 +209,7 @@
installed = [NSString stringWithFormat:@"<p>&nbsp;%@</p>", installed];
cell.webViewContent = [NSString stringWithFormat:@"%@%@", installed, appVersion.notes];
} else {
cell.webViewContent = [NSString stringWithFormat:@"<div style=\"min-height:200px;vertical-align:middle;text-align:center;text-shadow:rgba(255,255,255,0.6) 1px 1px 0px;\">%@</div>", BITHockeySDKLocalizedString(@"UpdateNoReleaseNotesAvailable")];
cell.webViewContent = [NSString stringWithFormat:@"<div style=\"min-height:200px;vertical-align:middle;text-align:center;text-shadow:rgba(255,255,255,0.6) 1px 1px 0px;\">%@</div>", BITHockeyLocalizedString(@"UpdateNoReleaseNotesAvailable")];
}
} else {
cell.webViewContent = [NSString stringWithFormat:@"<p><b style=\"text-shadow:rgba(255,255,255,0.6) 1px 1px 0px;\">%@</b>%@<br/><small>%@</small></p><p>%@</p>", [appVersion versionString], installed, [appVersion dateString], [appVersion notesOrEmptyString]];
@ -231,7 +231,7 @@
self.updateManager = newUpdateManager;
self.modal = newModal;
self.modalAnimated = YES;
self.title = BITHockeySDKLocalizedString(@"UpdateScreenTitle");
self.title = BITHockeyLocalizedString(@"UpdateScreenTitle");
_isAppStoreEnvironment = [BITHockeyManager sharedHockeyManager].isAppStoreEnvironment;
@ -562,7 +562,7 @@
if ([_cells count] > (NSUInteger)indexPath.row) {
return [_cells objectAtIndex:indexPath.row];
} else {
BITHockeySDKLog(@"Warning: cells_ and indexPath do not match? forgot calling redrawTableView?");
BITHockeyLog(@"Warning: cells_ and indexPath do not match? forgot calling redrawTableView?");
}
return nil;
}
@ -601,19 +601,19 @@
switch (anAppStoreButtonState) {
case AppStoreButtonStateOffline:
[_appStoreButton setButtonData:[PSStoreButtonData dataWithLabel:BITHockeySDKLocalizedString(@"UpdateButtonOffline") colors:[PSStoreButton appStoreGrayColor] enabled:NO] animated:animated];
[_appStoreButton setButtonData:[PSStoreButtonData dataWithLabel:BITHockeyLocalizedString(@"UpdateButtonOffline") colors:[PSStoreButton appStoreGrayColor] enabled:NO] animated:animated];
break;
case AppStoreButtonStateCheck:
[_appStoreButton setButtonData:[PSStoreButtonData dataWithLabel:BITHockeySDKLocalizedString(@"UpdateButtonCheck") colors:[PSStoreButton appStoreGreenColor] enabled:YES] animated:animated];
[_appStoreButton setButtonData:[PSStoreButtonData dataWithLabel:BITHockeyLocalizedString(@"UpdateButtonCheck") colors:[PSStoreButton appStoreGreenColor] enabled:YES] animated:animated];
break;
case AppStoreButtonStateSearching:
[_appStoreButton setButtonData:[PSStoreButtonData dataWithLabel:BITHockeySDKLocalizedString(@"UpdateButtonSearching") colors:[PSStoreButton appStoreGrayColor] enabled:NO] animated:animated];
[_appStoreButton setButtonData:[PSStoreButtonData dataWithLabel:BITHockeyLocalizedString(@"UpdateButtonSearching") colors:[PSStoreButton appStoreGrayColor] enabled:NO] animated:animated];
break;
case AppStoreButtonStateUpdate:
[_appStoreButton setButtonData:[PSStoreButtonData dataWithLabel:BITHockeySDKLocalizedString(@"UpdateButtonUpdate") colors:[PSStoreButton appStoreBlueColor] enabled:YES] animated:animated];
[_appStoreButton setButtonData:[PSStoreButtonData dataWithLabel:BITHockeyLocalizedString(@"UpdateButtonUpdate") colors:[PSStoreButton appStoreBlueColor] enabled:YES] animated:animated];
break;
case AppStoreButtonStateInstalling:
[_appStoreButton setButtonData:[PSStoreButtonData dataWithLabel:BITHockeySDKLocalizedString(@"UpdateButtonInstalling") colors:[PSStoreButton appStoreGrayColor] enabled:NO] animated:animated];
[_appStoreButton setButtonData:[PSStoreButtonData dataWithLabel:BITHockeyLocalizedString(@"UpdateButtonInstalling") colors:[PSStoreButton appStoreGrayColor] enabled:NO] animated:animated];
break;
default:
break;

View File

@ -41,6 +41,7 @@
#import "BITUpdateViewController.h"
#import "BITUpdateSettingsViewController.h"
// Notification message which HockeyManager is listening to, to retry requesting updated from the server
#define BITHockeyNetworkDidBecomeReachableNotification @"BITHockeyNetworkDidBecomeReachable"

View File

@ -52,11 +52,11 @@
#define BITHOCKEYSDK_BUNDLE @"HockeySDKResources"
#define BITHOCKEYSDK_URL @"https://sdk.hockeyapp.net/"
#define BITHockeySDKLog(fmt, ...) do { if([BITHockeyManager sharedHockeyManager].isLoggingEnabled) { NSLog((@"[HockeySDK] %s/%d " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); }} while(0)
#define BITHockeyLog(fmt, ...) do { if([BITHockeyManager sharedHockeyManager].isLoggingEnabled && ![BITHockeyManager sharedHockeyManager].isAppStoreEnvironment) { NSLog((@"[HockeySDK] %s/%d " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); }} while(0)
NSBundle *BITHockeySDKBundle(void);
NSString *BITHockeySDKLocalizedString(NSString *stringToken);
NSString *BITHockeySDKMD5(NSString *str);
NSBundle *BITHockeyBundle(void);
NSString *BITHockeyLocalizedString(NSString *stringToken);
NSString *BITHockeyMD5(NSString *str);
// compatibility helper

View File

@ -32,7 +32,7 @@
// Load the framework bundle.
NSBundle *BITHockeySDKBundle(void) {
NSBundle *BITHockeyBundle(void) {
static NSBundle *bundle = nil;
static dispatch_once_t predicate;
dispatch_once(&predicate, ^{
@ -43,15 +43,15 @@ NSBundle *BITHockeySDKBundle(void) {
return bundle;
}
NSString *BITHockeySDKLocalizedString(NSString *stringToken) {
if (BITHockeySDKBundle()) {
return NSLocalizedStringFromTableInBundle(stringToken, @"HockeySDK", BITHockeySDKBundle(), @"");
NSString *BITHockeyLocalizedString(NSString *stringToken) {
if (BITHockeyBundle()) {
return NSLocalizedStringFromTableInBundle(stringToken, @"HockeySDK", BITHockeyBundle(), @"");
} else {
return stringToken;
}
}
NSString *BITHockeySDKMD5(NSString *str) {
NSString *BITHockeyMD5(NSString *str) {
const char *cStr = [str UTF8String];
unsigned char result[CC_MD5_DIGEST_LENGTH];
CC_MD5( cStr, strlen(cStr), result );

View File

@ -1,5 +1,5 @@
//
// UIImage+BITHockeySDKAdditions.h
// UIImage+BITHockeyAdditions.h
//
// Created by Peter Steinberger on 10.01.11.
// Copyright (c) 2011-2012 Peter Steinberger.
@ -26,7 +26,7 @@
#import <UIKit/UIKit.h>
@interface UIImage (BITHockeySDKAdditions)
@interface UIImage (BITHockeyAdditions)
- (UIImage *)bit_roundedCornerImage:(NSInteger)cornerSize borderSize:(NSInteger)borderSize;
- (UIImage *)bit_imageToFitSize:(CGSize)fitSize honorScaleFactor:(BOOL)honorScaleFactor;

View File

@ -1,5 +1,5 @@
//
// UIImage+BITHockeySDKAdditions.m
// UIImage+BITHockeyAdditions.m
//
// Created by Peter Steinberger on 10.01.11.
// Copyright (c) 2011-2012 Peter Steinberger.

View File

@ -65,7 +65,6 @@
1E59557115B6F84700A03429 /* HockeySDK.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1E59555F15B6F80E00A03429 /* HockeySDK.strings */; };
1E59557315B6F84D00A03429 /* HockeySDK.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1E59555F15B6F80E00A03429 /* HockeySDK.strings */; };
1E59557515B6F85700A03429 /* HockeySDK.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1E59555F15B6F80E00A03429 /* HockeySDK.strings */; };
1E59557715B6F85E00A03429 /* HockeySDK.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1E59555F15B6F80E00A03429 /* HockeySDK.strings */; };
1E59557C15B6F8CC00A03429 /* HockeySDKResources.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 1E59550A15B6F45800A03429 /* HockeySDKResources.bundle */; };
1E59558D15B6FDA500A03429 /* PSAppStoreHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = E41EB469148D7BF50015DEDC /* PSAppStoreHeader.h */; };
1E59558E15B6FDA500A03429 /* PSStoreButton.h in Headers */ = {isa = PBXBuildFile; fileRef = E41EB46B148D7BF50015DEDC /* PSStoreButton.h */; };
@ -230,7 +229,7 @@
E41EB45D148D7BF50015DEDC /* BITUpdateManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = BITUpdateManager.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
E41EB45F148D7BF50015DEDC /* BITUpdateSettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BITUpdateSettingsViewController.h; sourceTree = "<group>"; };
E41EB460148D7BF50015DEDC /* BITUpdateSettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BITUpdateSettingsViewController.m; sourceTree = "<group>"; };
E41EB464148D7BF50015DEDC /* BITCrashManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BITCrashManager.m; sourceTree = "<group>"; };
E41EB464148D7BF50015DEDC /* BITCrashManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = BITCrashManager.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
E41EB465148D7BF50015DEDC /* BITHockeyManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BITHockeyManager.h; sourceTree = "<group>"; };
E41EB466148D7BF50015DEDC /* BITHockeyManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BITHockeyManager.m; sourceTree = "<group>"; };
E41EB468148D7BF50015DEDC /* NSString+BITHockeyAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+BITHockeyAdditions.m"; sourceTree = "<group>"; };
@ -671,7 +670,6 @@
1E59557115B6F84700A03429 /* HockeySDK.strings in Resources */,
1E59557315B6F84D00A03429 /* HockeySDK.strings in Resources */,
1E59557515B6F85700A03429 /* HockeySDK.strings in Resources */,
1E59557715B6F85E00A03429 /* HockeySDK.strings in Resources */,
1E5955C615B71C8600A03429 /* authorize_denied.png in Resources */,
1E5955C715B71C8600A03429 /* authorize_denied@2x.png in Resources */,
1E5955C815B71C8600A03429 /* authorize_request.png in Resources */,