More changes to the behavior of first forced user data and compose UI presentation

This is a change to previous behavior! Now the SDK by default shows the user data UI and subsequent compose UI always modally to ensure proper functionality on all scenarios the feedback viewer can be presented.

The new property `showFirstRequiredPresentationModal` in `BITFeedbackManager` can be set to `NO` if the previous behavior of pushing the UI and Compose view onto the stack, when those are being forced to be shown on the first presentation of the feedback UI. Especially if you present the UI in a popover, you should NOT change this property!
This commit is contained in:
Andreas Linde 2013-06-04 14:54:04 +02:00
parent 6960618748
commit d21b7b001c
3 changed files with 64 additions and 12 deletions

View File

@ -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){}];
}

View File

@ -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.
*/

View File

@ -71,6 +71,7 @@
_requireUserName = BITFeedbackUserDataElementOptional;
_requireUserEmail = BITFeedbackUserDataElementOptional;
_showAlertOnIncomingMessages = YES;
_showFirstRequiredPresentationModal = YES;
_disableFeedbackManager = NO;
_didSetupDidBecomeActiveNotifications = NO;