diff --git a/Classes/BITFeedbackListViewController.m b/Classes/BITFeedbackListViewController.m index 817a2647b1..bcda008e63 100644 --- a/Classes/BITFeedbackListViewController.m +++ b/Classes/BITFeedbackListViewController.m @@ -197,12 +197,16 @@ ) { self.userDataComposeFlow = YES; - // In case of presenting the feedback in a UIPopoverController it appears - // that the animation is not yet finished (though it should) and pushing - // the user data view on top of the navigation stack right away will - // cause the following warning to appear in the console: - // "nested push animation can result in corrupted navigation bar" - [self performSelector:@selector(showDelayedUserDataViewController) withObject:nil afterDelay:0.0]; + if ([self.manager showFirstRequiredPresentationModal]) { + [self setUserDataAction:nil]; + } else { + // In case of presenting the feedback in a UIPopoverController it appears + // that the animation is not yet finished (though it should) and pushing + // the user data view on top of the navigation stack right away will + // cause the following warning to appear in the console: + // "nested push animation can result in corrupted navigation bar" + [self performSelector:@selector(showDelayedUserDataViewController) withObject:nil afterDelay:0.0]; + } } else { [self.tableView reloadData]; } @@ -299,7 +303,15 @@ -(void)userDataUpdateCancelled { if (self.userDataComposeFlow) { - [self.navigationController popToViewController:self animated:YES]; + if ([self.manager showFirstRequiredPresentationModal]) { + __weak typeof(self) weakSelf = self; + [self dismissViewControllerAnimated:YES completion:^(void){ + typeof(self) strongSelf = weakSelf; + [strongSelf.tableView reloadData]; + }]; + } else { + [self.navigationController popToViewController:self animated:YES]; + } } else { [self dismissViewControllerAnimated:YES completion:^(void){}]; } @@ -309,10 +321,18 @@ [self.manager saveMessages]; if (self.userDataComposeFlow) { - BITFeedbackComposeViewController *composeController = [[BITFeedbackComposeViewController alloc] init]; - composeController.delegate = self; - - [self.navigationController pushViewController:composeController animated:YES]; + if ([self.manager showFirstRequiredPresentationModal]) { + __weak typeof(self) weakSelf = self; + [self dismissViewControllerAnimated:YES completion:^(void){ + typeof(self) strongSelf = weakSelf; + [strongSelf newFeedbackAction:nil]; + }]; + } else { + BITFeedbackComposeViewController *composeController = [[BITFeedbackComposeViewController alloc] init]; + composeController.delegate = self; + + [self.navigationController pushViewController:composeController animated:YES]; + } } else { [self dismissViewControllerAnimated:YES completion:^(void){}]; } @@ -323,7 +343,15 @@ - (void)feedbackComposeViewControllerDidFinish:(BITFeedbackComposeViewController *)composeViewController { if (self.userDataComposeFlow) { - [self.navigationController popToViewController:self animated:YES]; + if ([self.manager showFirstRequiredPresentationModal]) { + __weak typeof(self) weakSelf = self; + [self dismissViewControllerAnimated:YES completion:^(void){ + typeof(self) strongSelf = weakSelf; + [strongSelf.tableView reloadData]; + }]; + } else { + [self.navigationController popToViewController:self animated:YES]; + } } else { [self dismissViewControllerAnimated:YES completion:^(void){}]; } diff --git a/Classes/BITFeedbackManager.h b/Classes/BITFeedbackManager.h index 1bda3dfc71..e84996e40b 100644 --- a/Classes/BITFeedbackManager.h +++ b/Classes/BITFeedbackManager.h @@ -166,6 +166,29 @@ typedef enum { ///----------------------------------------------------------------------------- +/** + Indicates if an forced user data UI presentation is shown modal + + If `requireUserName` and/or `requireUserEmail` are enabled, the first presentation + of `feedbackListViewController:` and subsequent `feedbackComposeViewController:` + will automatically present a UI that lets the user provide this data and compose + a message. By default this is shown (since SDK 3.1) as a modal sheet. + + If you want the SDK to push this UI onto the navigation stack in this specific scenario, + then change the property to `NO`. + + @warning If you presenting the `BITFeedbackListViewController` in a popover, this property should not be changed! + + Default is `YES` + @see requireUserName + @see requireUserEmail + @see showFeedbackComposeView + @see feedbackComposeViewController: + @see showFeedbackListView + @see feedbackListViewController: + */ +@property (nonatomic, readwrite) BOOL showFirstRequiredPresentationModal; + /** Present the modal feedback list user interface. */ diff --git a/Classes/BITFeedbackManager.m b/Classes/BITFeedbackManager.m index eec35575e2..c54e76da40 100644 --- a/Classes/BITFeedbackManager.m +++ b/Classes/BITFeedbackManager.m @@ -71,6 +71,7 @@ _requireUserName = BITFeedbackUserDataElementOptional; _requireUserEmail = BITFeedbackUserDataElementOptional; _showAlertOnIncomingMessages = YES; + _showFirstRequiredPresentationModal = YES; _disableFeedbackManager = NO; _didSetupDidBecomeActiveNotifications = NO;