diff --git a/Classes/BITCrashManager.h b/Classes/BITCrashManager.h index 4edbfe6dd6..ca40c43e57 100644 --- a/Classes/BITCrashManager.h +++ b/Classes/BITCrashManager.h @@ -93,6 +93,7 @@ static NSString *kBITCrashManagerStatus = @"BITCrashManagerStatus"; NSURLConnection *_urlConnection; BOOL _sendingInProgress; + BOOL _isSetup; } diff --git a/Classes/BITCrashManager.m b/Classes/BITCrashManager.m index 6f6897e302..3da6337ed8 100644 --- a/Classes/BITCrashManager.m +++ b/Classes/BITCrashManager.m @@ -75,6 +75,7 @@ _delegate = nil; _showAlwaysButton = NO; + _isSetup = NO; _crashIdenticalCurrentVersion = YES; _urlConnection = nil; @@ -117,7 +118,7 @@ [_fileManager removeItemAtPath:_analyzerInProgressFile error:&error]; } - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(startManager) name:BITHockeyNetworkDidBecomeReachableNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(invokeDelayedProcessing) name:BITHockeyNetworkDidBecomeReachableNotification object:nil]; if (!BITHockeyBundle()) { NSLog(@"WARNING: %@ is missing, will send reports automatically!", BITHOCKEYSDK_BUNDLE); @@ -422,18 +423,29 @@ - (void)startManager { if (_crashManagerStatus == BITCrashManagerStatusDisabled) return; - PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; - NSError *error = NULL; - - // Check if we previously crashed - if ([crashReporter hasPendingCrashReport]) { - _didCrashInLastSession = YES; - [self handleCrashReport]; + if (!_isSetup) { + PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; + NSError *error = NULL; + + // Check if we previously crashed + if ([crashReporter hasPendingCrashReport]) { + _didCrashInLastSession = YES; + [self handleCrashReport]; + } + + // PLCrashReporter is throwing an NSException if it is being enabled again + // even though it already is enabled + @try { + // Enable the Crash Reporter + if (![crashReporter enableCrashReporterAndReturnError: &error]) + NSLog(@"WARNING: Could not enable crash reporter: %@", [error localizedDescription]); + } + @catch (NSException * e) { + NSLog(@"WARNING: %@", [e reason]); + } + + _isSetup = YES; } - - // Enable the Crash Reporter - if (![crashReporter enableCrashReporterAndReturnError: &error]) - NSLog(@"WARNING: Could not enable crash reporter: %@", [error localizedDescription]); [self performSelector:@selector(invokeDelayedProcessing) withObject:nil afterDelay:0.5]; } diff --git a/Classes/BITHockeyManager.m b/Classes/BITHockeyManager.m index dcbedb40d1..7a760b09a4 100644 --- a/Classes/BITHockeyManager.m +++ b/Classes/BITHockeyManager.m @@ -36,7 +36,7 @@ @interface BITHockeyManager () -- (BOOL)shouldUseLiveIdenfitier; +- (BOOL)shouldUseLiveIdentifier; - (void)configureJMC; @@ -117,7 +117,7 @@ _delegate = delegate; [_appIdentifier release]; - if ([self shouldUseLiveIdenfitier]) { + if ([self shouldUseLiveIdentifier]) { _appIdentifier = [liveIdentifier copy]; } else { @@ -178,10 +178,10 @@ #pragma mark - Private Instance Methods -- (BOOL)shouldUseLiveIdenfitier { +- (BOOL)shouldUseLiveIdentifier { BOOL delegateResult = NO; - if ([_delegate respondsToSelector:@selector(shouldUseLiveIdenfitier)]) { - delegateResult = [(NSObject *)_delegate shouldUseLiveIdenfitier]; + if ([_delegate respondsToSelector:@selector(shouldUseLiveIdentifier)]) { + delegateResult = [(NSObject *)_delegate shouldUseLiveIdentifier]; } return (delegateResult) || (_appStoreEnvironment); @@ -201,7 +201,7 @@ BITHockeyLog(@"Setup UpdateManager"); _updateManager = [[BITUpdateManager alloc] initWithAppIdentifier:_appIdentifier isAppStoreEnvironemt:_appStoreEnvironment]; - _crashManager.delegate = _delegate; + _updateManager.delegate = _delegate; // Only if JMC is part of the project if ([[self class] isJMCPresent]) { diff --git a/Classes/BITHockeyManagerDelegate.h b/Classes/BITHockeyManagerDelegate.h index ee97da9953..727cc9772b 100644 --- a/Classes/BITHockeyManagerDelegate.h +++ b/Classes/BITHockeyManagerDelegate.h @@ -46,13 +46,13 @@ the App Store. Example: - - (BOOL)shouldUseLiveIdenfitier { + - (BOOL)shouldUseLiveIdentifier { #ifdef (CONFIGURATION_Release) return YES; #endif return NO; } */ -- (BOOL)shouldUseLiveIdenfitier; +- (BOOL)shouldUseLiveIdentifier; @end \ No newline at end of file diff --git a/HockeySDK.podspec b/HockeySDK.podspec index f0ac0f6ca7..22383a4e74 100644 --- a/HockeySDK.podspec +++ b/HockeySDK.podspec @@ -6,30 +6,35 @@ Pod::Spec.new do |s| s.summary = 'Distribute beta apps and collect crash reports with HockeyApp.' s.homepage = 'http://hockeyapp.net/' s.author = { 'Andreas Linde' => 'mail@andreaslinde.de', 'Thomas Dohmke' => "thomas@dohmke.de" } - s.source = { :git => 'https://github.com/bitstadium/HockeySDK-iOS', :tag => '2.5.0' } + s.source = { :git => 'https://github.com/bitstadium/HockeySDK-iOS.git', :tag => '2.5.1' } - s.description = 'HockeyApp is a server to distribute beta apps and collect crash reports. ' \ - 'It improves the testing process dramatically and can be used for both beta ' \ - 'and App Store builds. Only beta builds will notify users about a new version ' \ - 'NOTE: You will need to add a dependency on JSONKit, SBJson or YAJL yourself. If you ' \ - 'want the framework to try again when a network is available, add a dependency ' \ + s.description = 'HockeyApp is a server to distribute beta apps and collect crash reports. ' \ + 'It improves the testing process dramatically and can be used for both beta ' \ + 'and App Store builds. Only beta builds will notify users about a new version ' \ + 'NOTE: You will need to add a dependency on JSONKit, SBJson or YAJL yourself. If you ' \ + 'want the framework to try again when a network is available, add a dependency ' \ 'on Reachability and send a notification with the name `BITHockeyNetworkDidBecomeReachable` ' \ 'yourself when the network becomse reachable.' s.source_files = 'Classes' s.requires_arc = false - s.resources = 'Resources/HockeySDKResources.bundle' - s.frameworks = 'QuartzCore', 'SystemConfiguration', 'CrashReporter', 'CoreGraphics.framework', 'UIKit.framework' - s.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '"$(BUILT_PRODUCTS_DIR)/Pods/Frameworks"' } + s.preserve_paths = 'Resources', 'Support', 'Vendor' + s.frameworks = 'QuartzCore', 'SystemConfiguration', 'CrashReporter', 'CoreGraphics', 'UIKit' + s.xcconfig = { 'FRAMEWORK_SEARCH_PATHS' => '"$(PODS_ROOT)/HockeySDK/Vendor"', + 'GCC_PREPROCESSOR_DEFINITIONS' => %{BITHOCKEY_VERSION="@\\"#{s.version}\\""} } def s.post_install(target_installer) - # Add a copy build phase and make it copy the CrashReporter.framework to the shared BUILT_PRODUCTS_DIR, - # so that both the Pods project and the user's project will pick it up. - phase = target_installer.target.buildPhases.add(Xcodeproj::Project::PBXCopyFilesBuildPhase, 'dstPath' => 'Pods/Frameworks') - file = target_installer.project.main_group.files.new('path' => 'HockeySDK/Vendor/CrashReporter.framework') - phase.files << file.buildFiles.new - phases = target_installer.target.attributes['buildPhases'] - phases.delete(phase.uuid) - phases.insert(1, phase.uuid) - end -end \ No newline at end of file + puts "\nGenerating HockeySDK resources bundle\n".yellow if config.verbose? + Dir.chdir File.join(config.project_pods_root, 'HockeySDK/Support') do + command = "xcodebuild -project HockeySDK.xcodeproj -target HockeySDKResources CONFIGURATION_BUILD_DIR=../Resources" + command << " 2>&1 > /dev/null" unless config.verbose? + unless system(command) + raise ::Pod::Informative, "Failed to generate HockeySDK resources bundle" + end + end + File.open(File.join(config.project_pods_root, target_installer.target_definition.copy_resources_script_name), 'a') do |file| + file.puts "install_resource 'HockeySDK/Resources/HockeySDKResources.bundle'" + end + end +end + diff --git a/README.md b/README.md index cc95ed4288..e43f201003 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,19 @@ This documentation provides integrated help in Xcode for all public APIs and a s ## Changelog -### Version 2.5 +### Version 2.5.1 + +- General: + + - [BUGFIX] Typo in delegate `shouldUseLiveIdentifier` of `BITHockeyManagerDelegate` + - [BUGFIX] Default updateManager delegate wasn't set + +- Crash Reporting: + + - [BUGFIX] Crash when developer sends the notification `BITHockeyNetworkDidBecomeReachableNotification` + + +### Version 2.5.0 - General: diff --git a/Support/buildnumber.xcconfig b/Support/buildnumber.xcconfig index 80d0d5005e..4ed940094b 100644 --- a/Support/buildnumber.xcconfig +++ b/Support/buildnumber.xcconfig @@ -1,3 +1,3 @@ -BUILD_NUMBER = 1 -VERSION_STRING = 2.5.0 -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) BITHOCKEY_VERSION="@\"2.5.0\"" +BUILD_NUMBER = 2 +VERSION_STRING = 2.5.1 +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) BITHOCKEY_VERSION="@\"2.5.1\"" diff --git a/docs/Changelog-template.md b/docs/Changelog-template.md index 937e8744e1..a1b61c981d 100644 --- a/docs/Changelog-template.md +++ b/docs/Changelog-template.md @@ -1,3 +1,15 @@ +## Version 2.5.1 + +- General: + + - [BUGFIX] Typo in delegate `shouldUseLiveIdentifier` of `BITHockeyManagerDelegate` + - [BUGFIX] Default updateManager delegate wasn't set + +- Crash Reporting: + + - [BUGFIX] Crash when developer sends the notification `BITHockeyNetworkDidBecomeReachableNotification` + + ## Version 2.5 - General: diff --git a/docs/Guide-Migration-Kits-template.md b/docs/Guide-Migration-Kits-template.md index 3b4cfbfd93..c9f4546912 100644 --- a/docs/Guide-Migration-Kits-template.md +++ b/docs/Guide-Migration-Kits-template.md @@ -100,6 +100,12 @@ Now follow the steps described in our [setup guide](http://support.hockeyapp.net After you have finished the setup guide make sure everything works as expected and then delete the out commented lines from above. +## Troubleshooting + +### ld: warning: directory not found for option '....QuincyKit.....' + +This warning means there is still a `Framework Search Path` pointing to the folder of the old SDK. Open the `Project Navigator` (⌘+1) and go to the tab `Build Settings`. In the search field enter the name of the folder mentioned in the warning (for example "QuincyKit") . If the search finds something in `Framework Search Paths` you should double click that entry and remove the line which points to the old folder. + ## Advanced Migration If you used any optional API calls, for example adding a custom description to a crash report, migrating those would exceed the scope of this guide. Please have a look at the [API documentation](https://github.com/bitstadium/HockeySDK-iOS/downloads).