Merge branch 'refs/heads/develop' into feature/CrashReporting

This commit is contained in:
Andreas Linde
2014-05-20 13:31:30 +02:00
5 changed files with 14 additions and 13 deletions

View File

@@ -43,7 +43,7 @@
/**
* The attachment data as NSData object
*/
@property (nonatomic, readonly, strong) NSData *attachmentData;
@property (nonatomic, readonly, strong) NSData *crashAttachmentData;
/**
* The content type of your data as MIME type
@@ -60,7 +60,7 @@
* @return An instsance of BITCrashAttachment
*/
- (instancetype)initWithFilename:(NSString *)filename
attachmentData:(NSData *)attachmentData
crashAttachmentData:(NSData *)crashAttachmentData
contentType:(NSString *)contentType;
@end

View File

@@ -31,12 +31,12 @@
@implementation BITCrashAttachment
- (instancetype)initWithFilename:(NSString *)filename
attachmentData:(NSData *)attachmentData
crashAttachmentData:(NSData *)crashAttachmentData
contentType:(NSString *)contentType
{
if (self = [super init]) {
_filename = filename;
_attachmentData = attachmentData;
_crashAttachmentData = crashAttachmentData;
_contentType = contentType;
}
@@ -48,14 +48,14 @@
- (void)encodeWithCoder:(NSCoder *)encoder {
[encoder encodeObject:self.filename forKey:@"filename"];
[encoder encodeObject:self.attachmentData forKey:@"data"];
[encoder encodeObject:self.crashAttachmentData forKey:@"data"];
[encoder encodeObject:self.contentType forKey:@"contentType"];
}
- (id)initWithCoder:(NSCoder *)decoder {
if ((self = [super init])) {
_filename = [decoder decodeObjectForKey:@"filename"];
_attachmentData = [decoder decodeObjectForKey:@"data"];
_crashAttachmentData = [decoder decodeObjectForKey:@"data"];
_contentType = [decoder decodeObjectForKey:@"contentType"];
}
return self;

View File

@@ -1378,7 +1378,7 @@ static PLCrashReporterCallbacks plCrashCallbacks = {
filename:@"crash.xml"]];
if (attachment) {
[postBody appendData:[BITHockeyAppClient dataWithPostValue:attachment.attachmentData
[postBody appendData:[BITHockeyAppClient dataWithPostValue:attachment.crashAttachmentData
forKey:@"attachment0"
contentType:attachment.contentType
boundary:boundary

View File

@@ -66,7 +66,7 @@
NSData *data = [NSData dataWithContentsOfURL:@"mydatafile"];
BITCrashAttachment *attachment = [[BITCrashAttachment alloc] initWithFilename:@"myfile.data"
attachmentData:data
crashAttachmentData:data
contentType:@"'application/octet-stream"];
return attachment;
}

View File

@@ -108,7 +108,8 @@ typedef NS_ENUM(NSInteger, BITUpdateAlertViewTag) {
if ([self expiryDateReached]) return;
[self startUsage];
if (_checkForUpdateOnLaunch) {
if ([self isCheckForUpdateOnLaunch] && [self shouldCheckForUpdates]) {
[self checkForUpdate];
}
}
@@ -424,10 +425,6 @@ typedef NS_ENUM(NSInteger, BITUpdateAlertViewTag) {
self.lastCheck = [NSDate distantPast];
}
if (self.delegate != nil && [self.delegate respondsToSelector:@selector(updateManagerShouldSendUsageData:)]) {
_sendUsageData = [self.delegate updateManagerShouldSendUsageData:self];
}
if (!BITHockeyBundle()) {
NSLog(@"[HockeySDK] WARNING: %@ is missing, make sure it is added!", BITHOCKEYSDK_BUNDLE);
}
@@ -763,6 +760,10 @@ typedef NS_ENUM(NSInteger, BITUpdateAlertViewTag) {
BITHockeyLog(@"INFO: Starting UpdateManager");
if (self.delegate != nil && [self.delegate respondsToSelector:@selector(updateManagerShouldSendUsageData:)]) {
_sendUsageData = [self.delegate updateManagerShouldSendUsageData:self];
}
[self checkExpiryDateReached];
if (![self expiryDateReached]) {
if ([self checkForTracker] || ([self isCheckForUpdateOnLaunch] && [self shouldCheckForUpdates])) {