10
10
#import < UIKit/UIKit.h>
11
11
12
12
#import " IterableInAppManager.h"
13
- #import " IterableConstants.h"
14
- #import " IterableNotificationMetadata.h"
15
13
#import " IterableInAppHTMLViewController.h"
16
14
#import " IterableLogging.h"
17
15
@@ -31,7 +29,7 @@ @implementation IterableInAppManager
31
29
static NSString *const IN_APP_AUTO_EXPAND = @" AutoExpand" ;
32
30
33
31
// documented in IterableInAppManager.h
34
- +(void ) showIterableNotificationHTML : (NSString *)htmlString trackParams : (IterableNotificationMetadata*)trackParams callbackBlock : (ITEActionBlock)callbackBlock backgroundAlpha : (double )backgroundAlpha padding : (UIEdgeInsets)padding {
32
+ +(BOOL ) showIterableNotificationHTML : (NSString *)htmlString trackParams : (IterableNotificationMetadata*)trackParams callbackBlock : (ITEActionBlock)callbackBlock backgroundAlpha : (double )backgroundAlpha padding : (UIEdgeInsets)padding {
35
33
if (htmlString != NULL ) {
36
34
UIViewController *topViewController = [UIApplication sharedApplication ].delegate .window .rootViewController ;
37
35
if ([topViewController isKindOfClass: [UIViewController class ]])
@@ -44,7 +42,7 @@ +(void) showIterableNotificationHTML:(NSString*)htmlString trackParams:(Iterable
44
42
45
43
if ([topViewController isKindOfClass: [IterableInAppHTMLViewController class ]]) {
46
44
LogWarning (@" Skipping the in-app notification: another notification is already being displayed" );
47
- return ;
45
+ return NO ;
48
46
}
49
47
50
48
IterableInAppHTMLViewController *baseNotification;
@@ -54,10 +52,13 @@ +(void) showIterableNotificationHTML:(NSString*)htmlString trackParams:(Iterable
54
52
[baseNotification ITESetPadding: padding];
55
53
56
54
topViewController.definesPresentationContext = YES ;
57
- baseNotification.view .backgroundColor = [UIColor colorWithWhite: 0 alpha: backgroundAlpha];;
55
+ baseNotification.view .backgroundColor = [UIColor colorWithWhite: 0 alpha: backgroundAlpha];
58
56
baseNotification.modalPresentationStyle = UIModalPresentationOverCurrentContext;
59
57
60
58
[topViewController presentViewController: baseNotification animated: NO completion: nil ];
59
+ return YES ;
60
+ } else {
61
+ return NO ;
61
62
}
62
63
}
63
64
0 commit comments