diff --git a/Classes/Helper/BITHockeyHelper.m b/Classes/Helper/BITHockeyHelper.m index 48c1dd8a..a0573af8 100644 --- a/Classes/Helper/BITHockeyHelper.m +++ b/Classes/Helper/BITHockeyHelper.m @@ -74,6 +74,10 @@ NSComparisonResult bit_versionCompare(NSString *stringA, NSString *stringB) { #pragma mark Exclude from backup fix void bit_fixBackupAttributeForURL(NSURL *directoryURL) { + if (&NSURLIsExcludedFromBackupKey == NULL) { + BITHockeyLogWarning(@"WARNING: &NSURLIsExcludedBackupKey is NULL, returning"); + return; + } BOOL shouldExcludeAppSupportDirFromBackup = [[NSUserDefaults standardUserDefaults] boolForKey:kBITExcludeApplicationSupportFromBackup]; if (shouldExcludeAppSupportDirFromBackup) { diff --git a/Classes/Telemetry/BITPersistence.m b/Classes/Telemetry/BITPersistence.m index 5b4c6ded..2fc0c663 100644 --- a/Classes/Telemetry/BITPersistence.m +++ b/Classes/Telemetry/BITPersistence.m @@ -218,13 +218,16 @@ - (void)createDirectoryStructureIfNeeded { return; } - //Exclude HockeySDK folder from backup - if (![appURL setResourceValue:@YES - forKey:NSURLIsExcludedFromBackupKey - error:&error]) { - BITHockeyLogError(@"Error excluding %@ from backup %@", appURL.lastPathComponent, error.localizedDescription); - } else { - BITHockeyLogDebug(@"Exclude %@ from backup", appURL); + // Make sure NSURLIsExcludedFromBackupKey is available + if (&NSURLIsExcludedFromBackupKey != NULL) { + //Exclude HockeySDK folder from backup + if (![appURL setResourceValue:@YES + forKey:NSURLIsExcludedFromBackupKey + error:&error]) { + BITHockeyLogError(@"ERROR: Error excluding %@ from backup %@", appURL.lastPathComponent, error.localizedDescription); + } else { + BITHockeyLogDebug(@"INFO: Exclude %@ from backup", appURL); + } } _directorySetupComplete = YES; diff --git a/README.md b/README.md index 01ce8bc7..250b5d7b 100644 --- a/README.md +++ b/README.md @@ -269,6 +269,7 @@ and set the delegate: ### 3.3 User Metrics HockeyApp automatically provides you with nice, intelligible, and informative metrics about how your app is used and by whom. + - **Sessions**: A new session is tracked by the SDK whenever the containing app is restarted (this refers to a 'cold start', i.e. when the app has not already been in memory prior to being launched) or whenever it becomes active again after having been in the background for 20 seconds or more. - **Users**: The SDK anonymously tracks the users of your app by creating a random UUID that is then securely stored in the iOS keychain. Because this anonymous ID is stored in the keychain it persists across reinstallations. - **Custom Events**: If you are part of [Preseason](https://www.hockeyapp.net/preseason/), you can now track Custom Events in your app, understand user actions and see the aggregates on the HockeyApp portal. diff --git a/docs/Changelog-template.md b/docs/Changelog-template.md index 782a06a9..1713cff9 100644 --- a/docs/Changelog-template.md +++ b/docs/Changelog-template.md @@ -32,6 +32,10 @@ NSUserDefaults.standardUserDefaults().setBool(true, forKey: "BITExcludeApplicati - [IMPROVEMENT] Reuse `NSURLSession` object - [IMPROVEMENT] Under the hood improvements and cleanup +## Version 4.0.2 + +- [BUGFIX] Restore compatibility with OS X 10.7 by not accessing `NSURLIsExcludedFromBackupKey` if not available + ## Version 4.0.1 - [BUGFIX] Fixes an issue where the whole app's Application Support directory (sandboxed apps) / user’s Application Support directory (non-sandboxed apps) was accidentally excluded from backups. diff --git a/docs/Guide-Installation-Setup-template.md b/docs/Guide-Installation-Setup-template.md index 6138a3a8..e7f23c70 100644 --- a/docs/Guide-Installation-Setup-template.md +++ b/docs/Guide-Installation-Setup-template.md @@ -255,6 +255,7 @@ and set the delegate: ### 3.3 User Metrics HockeyApp automatically provides you with nice, intelligible, and informative metrics about how your app is used and by whom. + - **Sessions**: A new session is tracked by the SDK whenever the containing app is restarted (this refers to a 'cold start', i.e. when the app has not already been in memory prior to being launched) or whenever it becomes active again after having been in the background for 20 seconds or more. - **Users**: The SDK anonymously tracks the users of your app by creating a random UUID that is then securely stored in the iOS keychain. Because this anonymous ID is stored in the keychain it persists across reinstallations. - **Custom Events**: If you are part of [Preseason](https://www.hockeyapp.net/preseason/), you can now track Custom Events in your app, understand user actions and see the aggregates on the HockeyApp portal.