File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
iOS_SDK/OneSignalSDK/OneSignalNotifications Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,10 @@ - (void)complete:(OSDisplayableNotification *)notification {
8585 }
8686}
8787
88+ - (BOOL )wantsToDisplay {
89+ return _wantsToDisplay;
90+ }
91+
8892- (void )setWantsToDisplay : (BOOL )display {
8993 _wantsToDisplay = display;
9094}
Original file line number Diff line number Diff line change @@ -93,13 +93,12 @@ @interface OSDisplayableNotification ()
9393- (void )startTimeoutTimer ;
9494- (void )setCompletionBlock : (OSNotificationDisplayResponse)completion ;
9595- (void )complete : (OSDisplayableNotification *)notification ;
96+ - (BOOL )wantsToDisplay ;
9697- (void )setWantsToDisplay : (BOOL )display ;
9798@end
9899
99100@implementation OSNotificationWillDisplayEvent
100101
101- BOOL _isPreventDefault = false ;
102-
103102- (id )initWithDisplayableNotification : (OSDisplayableNotification*)notification {
104103 self = [super init ];
105104 if (self) {
@@ -109,12 +108,11 @@ - (id)initWithDisplayableNotification:(OSDisplayableNotification*)notification {
109108}
110109
111110- (BOOL )isPreventDefault {
112- return _isPreventDefault ;
111+ return !_notification. wantsToDisplay ;
113112}
114113
115114- (void )preventDefault {
116115 [OneSignalLog onesignalLog: ONE_S_LL_VERBOSE message: [NSString stringWithFormat: @" OSNotificationWillDisplayEvent.preventDefault called." ]];
117- _isPreventDefault = true ;
118116 _notification.wantsToDisplay = false ;
119117}
120118
You can’t perform that action at this time.
0 commit comments