Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

Commit

Permalink
Merge pull request #333 from bitstadium/release/4.1.1
Browse files Browse the repository at this point in the history
Release/4.1.1
  • Loading branch information
Benjamin Scholtysik (Reimold) authored Sep 13, 2016
2 parents c081375 + 793f0e5 commit 273495d
Show file tree
Hide file tree
Showing 49 changed files with 2,912 additions and 831 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ before_install:
- brew install carthage

script:
- open -b com.apple.iphonesimulator
- set -o pipefail
- COMMAND="env NSUnbufferedIO=YES xcodebuild -project '$PROJECT' -scheme '$SCHEME' -sdk '$SDK' -configuration '$CONFIGURATION'"

Expand All @@ -51,4 +52,4 @@ after_failure:
- cat xcodebuild.log
- cat -n $TMPDIR/com.apple.dt.XCTest-status/Session*.log
- cat -n ~/Library/Logs/DiagnosticReports/xctest*.crash
- sleep 5
- sleep 5
488 changes: 428 additions & 60 deletions Classes/BITAttributedLabel.h

Large diffs are not rendered by default.

1,821 changes: 1,347 additions & 474 deletions Classes/BITAttributedLabel.m

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions Classes/BITAuthenticator.m
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,11 @@ - (void)authenticationViewController:(UIViewController *)viewController
NSParameterAssert(email && email.length);
NSParameterAssert(self.identificationType == BITAuthenticatorIdentificationTypeHockeyAppEmail || (password && password.length));

// Trim whitespace from email in case the user has added a whitespace at the end of the email address. This shouldn't
// happen if devs use our UI but we've had 1-2 support tickets where the email contained whitespace at the end and
// verification failed because of that.
email = [email stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];

NSURLRequest *request = [self requestForAuthenticationEmail:email password:password];

[self authenticationViewController:viewController handleAuthenticationWithEmail:email request:request completion:completion];
Expand Down Expand Up @@ -787,7 +792,7 @@ - (void)alertOnFailureStoringTokenInKeychain {
return;
}

NSLog(@"[HockeySDK] ERROR: The authentication token could not be stored due to a keychain error. This is most likely a signing or keychain entitlement issue!");
BITHockeyLogError(@"[HockeySDK] ERROR: The authentication token could not be stored due to a keychain error. This is most likely a signing or keychain entitlement issue!");
}

- (void)cleanupInternalStorage {
Expand Down Expand Up @@ -933,10 +938,8 @@ - (void)storeInstallationIdentifier:(NSString *)installationIdentifier withType:
} else {
BOOL success1 = [self addStringValueToKeychainForThisDeviceOnly:installationIdentifier
forKey:kBITAuthenticatorIdentifierKey];
NSParameterAssert(success1);
BOOL success2 = [self addStringValueToKeychainForThisDeviceOnly:[self.class stringForIdentificationType:type]
forKey:kBITAuthenticatorIdentifierTypeKey];
NSParameterAssert(success2);
if (!success1 || !success2) {
[self alertOnFailureStoringTokenInKeychain];
}
Expand All @@ -955,7 +958,9 @@ - (void)setLastAuthenticatedVersion:(NSString *)lastAuthenticatedVersion {
} else {
[defaults setObject:lastAuthenticatedVersion
forKey:kBITAuthenticatorLastAuthenticatedVersionKey];
[defaults synchronize];
if(bit_isPreiOS8Environment()) {
[defaults synchronize];
}
}
}

Expand Down
27 changes: 21 additions & 6 deletions Classes/BITCrashManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,10 @@ - (BOOL)persistAttachment:(BITHockeyAttachment *)attachment withFilename:(NSStri

- (void)persistUserProvidedMetaData:(BITCrashMetaData *)userProvidedMetaData {
if (!userProvidedMetaData) return;
if (userProvidedMetaData.userDescription && [userProvidedMetaData.userDescription length] > 0) {

if (userProvidedMetaData.userProvidedDescription && [userProvidedMetaData.userProvidedDescription length] > 0) {
NSError *error;
[userProvidedMetaData.userDescription writeToFile:[NSString stringWithFormat:@"%@.desc", [_crashesDir stringByAppendingPathComponent: _lastCrashFilename]] atomically:YES encoding:NSUTF8StringEncoding error:&error];
[userProvidedMetaData.userProvidedDescription writeToFile:[NSString stringWithFormat:@"%@.desc", [_crashesDir stringByAppendingPathComponent: _lastCrashFilename]] atomically:YES encoding:NSUTF8StringEncoding error:&error];
}

if (userProvidedMetaData.userName && [userProvidedMetaData.userName length] > 0) {
Expand Down Expand Up @@ -521,8 +521,11 @@ - (void) registerObservers {
// we only need to log this once
if (!_didLogLowMemoryWarning) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kBITAppDidReceiveLowMemoryNotification];
[[NSUserDefaults standardUserDefaults] synchronize];
_didLogLowMemoryWarning = YES;
if(bit_isPreiOS8Environment()) {
// calling synchronize in pre-iOS 8 takes longer to sync than in iOS 8+, calling synchronize explicitly.
[[NSUserDefaults standardUserDefaults] synchronize];
}
}
}];
}
Expand All @@ -548,7 +551,10 @@ - (void) unregisterObserver:(id)observer {
- (void)leavingAppSafely {
if (self.isAppNotTerminatingCleanlyDetectionEnabled) {
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kBITAppWentIntoBackgroundSafely];
[[NSUserDefaults standardUserDefaults] synchronize];
if(bit_isPreiOS8Environment()) {
// calling synchronize in pre-iOS 8 takes longer to sync than in iOS 8+, calling synchronize explicitly.
[[NSUserDefaults standardUserDefaults] synchronize];
}
}
}

Expand Down Expand Up @@ -579,6 +585,10 @@ - (void)appEnteredForeground {
];

[[NSUserDefaults standardUserDefaults] setObject:uuidString forKey:kBITAppUUIDs];
if(bit_isPreiOS8Environment()) {
// calling synchronize in pre-iOS 8 takes longer to sync than in iOS 8+, calling synchronize explicitly.
[[NSUserDefaults standardUserDefaults] synchronize];
}
});
}
}
Expand Down Expand Up @@ -821,6 +831,7 @@ - (BOOL)handleUserInput:(BITCrashManagerUserInput)userInput withUserProvidedMeta
case BITCrashManagerUserInputAlwaysSend:
_crashManagerStatus = BITCrashManagerStatusAutoSend;
[[NSUserDefaults standardUserDefaults] setInteger:_crashManagerStatus forKey:kBITCrashManagerStatus];

if ([self.delegate respondsToSelector:@selector(crashManagerWillSendCrashReportsAlways:)]) {
[self.delegate crashManagerWillSendCrashReportsAlways:self];
}
Expand Down Expand Up @@ -1274,7 +1285,11 @@ - (void)startManager {
#endif

[[NSUserDefaults standardUserDefaults] setBool:NO forKey:kBITAppDidReceiveLowMemoryNotification];
[[NSUserDefaults standardUserDefaults] synchronize];

if(bit_isPreiOS8Environment()) {
// calling synchronize in pre-iOS 8 takes longer to sync than in iOS 8+, calling synchronize explicitly.
[[NSUserDefaults standardUserDefaults] synchronize];
}

[self triggerDelayedProcessing];
BITHockeyLogVerbose(@"VERBOSE: CrashManager startManager has finished.");
Expand Down
2 changes: 1 addition & 1 deletion Classes/BITCrashMetaData.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
/**
* User provided description that should be attached to the crash report as plain text
*/
@property (nonatomic, copy) NSString *userDescription;
@property (nonatomic, copy) NSString *userProvidedDescription;

/**
* User name that should be attached to the crash report
Expand Down
2 changes: 1 addition & 1 deletion Classes/BITCrashReportTextFormatter.m
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ + (NSString *)bit_formatStackFrame: (BITPLCrashReportStackFrameInfo *) frameInfo
break;

default:
NSLog(@"Symbol prefix rules are unknown for this OS!");
BITHockeyLogDebug(@"Symbol prefix rules are unknown for this OS!");
break;
}
}
Expand Down
3 changes: 2 additions & 1 deletion Classes/BITData.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#import "BITData.h"
#import "BITHockeyLogger.h"

/// Data contract class for type Data.
@implementation BITData
Expand All @@ -13,7 +14,7 @@ - (NSDictionary *)serializeToDictionary {
if ([NSJSONSerialization isValidJSONObject:baseDataDict]) {
[dict setObject:baseDataDict forKey:@"baseData"];
} else {
NSLog(@"[HockeyApp] Some of the telemetry data was not NSJSONSerialization compatible and could not be serialized!");
BITHockeyLogError(@"[HockeySDK] Some of the telemetry data was not NSJSONSerialization compatible and could not be serialized!");
}
return dict;
}
Expand Down
3 changes: 2 additions & 1 deletion Classes/BITEnvelope.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#import "BITEnvelope.h"
#import "BITData.h"
#import "BITHockeyLogger.h"

/// Data contract class for type Envelope.
@implementation BITEnvelope
Expand Down Expand Up @@ -67,7 +68,7 @@ - (NSDictionary *)serializeToDictionary {
if ([NSJSONSerialization isValidJSONObject:dataDict]) {
[dict setObject:dataDict forKey:@"data"];
} else {
NSLog(@"[HockeyApp] Some of the telemetry data was not NSJSONSerialization compatible and could not be serialized!");
BITHockeyLogError(@"[HockeySDK] Some of the telemetry data was not NSJSONSerialization compatible and could not be serialized!");
}
return dict;
}
Expand Down
Loading

0 comments on commit 273495d

Please sign in to comment.