Skip to content

Commit 626503c

Browse files
authored
Merge pull request #366 from apptentive/feature/close-all-ui-3
Add "cause" to About VC close event if needed
2 parents 1f19de2 + 3a073e9 commit 626503c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

ApptentiveConnect/source/Message Center/Controllers/ApptentiveAboutViewController.m

+11-2
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ @interface ApptentiveAboutViewController ()
2828
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *privacyButtonLeadingConstraint;
2929
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *aboutButtonPrivacyButtonVeritcalConstraint;
3030

31-
3231
@property (strong, nonatomic) NSArray *portraitConstraints;
3332
@property (strong, nonatomic) NSArray *landscapeConstraints;
3433

34+
@property (strong, nonatomic) NSDictionary *closeEventUserInfo;
35+
3536
@end
3637

3738

@@ -56,12 +57,16 @@ - (void)viewDidLoad {
5657

5758
self.landscapeConstraints = [NSLayoutConstraint constraintsWithVisualFormat:@"H:[about]-(16)-[privacy]" options:NSLayoutFormatAlignAllBaseline metrics:nil views:@{ @"about": self.aboutButton,
5859
@"privacy": self.privacyButton }];
60+
61+
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(addCause) name:ApptentiveInteractionsShouldDismissNotification object:nil];
5962
}
6063

6164
- (void)viewWillDisappear:(BOOL)animated {
6265
[super viewWillDisappear:animated];
6366

64-
[[Apptentive sharedConnection].engagementBackend engageCodePoint:[self codePointForEvent:ATInteractionAboutViewEventLabelClose] fromInteraction:nil userInfo:nil customData:nil extendedData:nil fromViewController:self];
67+
[[NSNotificationCenter defaultCenter] removeObserver:self];
68+
69+
[[Apptentive sharedConnection].engagementBackend engageCodePoint:[self codePointForEvent:ATInteractionAboutViewEventLabelClose] fromInteraction:nil userInfo:self.closeEventUserInfo customData:nil extendedData:nil fromViewController:self];
6570
}
6671

6772
- (IBAction)learnMore:(id)sender {
@@ -102,4 +107,8 @@ - (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection {
102107
[self.view layoutIfNeeded];
103108
}
104109

110+
- (void)addCause {
111+
self.closeEventUserInfo = @{ @"cause" : @"notification"};
112+
}
113+
105114
@end

0 commit comments

Comments
 (0)