diff --git a/Classes/BITFeedbackListViewController.m b/Classes/BITFeedbackListViewController.m index 88b92d2ef6..27ed0d80ec 100644 --- a/Classes/BITFeedbackListViewController.m +++ b/Classes/BITFeedbackListViewController.m @@ -782,8 +782,9 @@ previewController.dataSource = self; [self presentViewController:previewController animated:YES completion:nil]; - + if (self.cachedPreviewItems.count > [self.cachedPreviewItems indexOfObject:attachment]){ [previewController setCurrentPreviewItemIndex:[self.cachedPreviewItems indexOfObject:attachment]]; + } } - (void)refreshPreviewItems { diff --git a/Classes/BITFeedbackManager.h b/Classes/BITFeedbackManager.h index 02441bebf3..01ad9a46a6 100644 --- a/Classes/BITFeedbackManager.h +++ b/Classes/BITFeedbackManager.h @@ -32,6 +32,7 @@ #import "BITHockeyBaseManager.h" #import "BITFeedbackListViewController.h" #import "BITFeedbackComposeViewController.h" +#import "HockeySDKPrivate.h" // Notification message which tells that loading messages finished diff --git a/Classes/BITFeedbackManager.m b/Classes/BITFeedbackManager.m index 35a5e46f73..9f905a3b81 100644 --- a/Classes/BITFeedbackManager.m +++ b/Classes/BITFeedbackManager.m @@ -1093,13 +1093,21 @@ -(void)setFeedbackObservationMode:(BITFeedbackObservationMode)mode { if (mode == BITFeedbackObservationModeOnScreenshot){ + if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1){ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(screenshotNotificationReceived:) name:UIApplicationUserDidTakeScreenshotNotification object:nil]; + } else { + BITHockeyLog("Not enabling Screenshot notifications: iOS6.1 and lower is not supported."); + } + self.screenshotNotificationEnabled = YES; + if (self.tapRecognizer){ [[[UIApplication sharedApplication] keyWindow] removeGestureRecognizer:self.tapRecognizer]; self.tapRecognizer = nil; } - } else if (mode == BITFeedbackObservationModeThreeFingerTap){ + } + + if (mode == BITFeedbackObservationModeThreeFingerTap){ if (!self.tapRecognizer){ self.tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(screenshotTripleTap:)]; self.tapRecognizer.numberOfTouchesRequired = 3; @@ -1111,8 +1119,10 @@ } if (self.screenshotNotificationEnabled){ - [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationUserDidTakeScreenshotNotification object:nil]; - self.screenshotNotificationEnabled = NO; + if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1){ + [[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationUserDidTakeScreenshotNotification object:nil]; + self.screenshotNotificationEnabled = NO; + } } } }