144bbe92dSŁukasz Kosmaty// Copyright 2018-present 650 Industries. All rights reserved. 244bbe92dSŁukasz Kosmaty 344bbe92dSŁukasz Kosmaty#import "EXScopedNotificationsHandlerModule.h" 444bbe92dSŁukasz Kosmaty#import "EXScopedNotificationsUtils.h" 544bbe92dSŁukasz Kosmaty 644bbe92dSŁukasz Kosmaty@interface EXScopedNotificationsHandlerModule () 744bbe92dSŁukasz Kosmaty 8*167fd314SWill Schurman@property (nonatomic, strong) NSString *scopeKey; 944bbe92dSŁukasz Kosmaty 1044bbe92dSŁukasz Kosmaty@end 1144bbe92dSŁukasz Kosmaty 1244bbe92dSŁukasz Kosmaty@implementation EXScopedNotificationsHandlerModule 1344bbe92dSŁukasz Kosmaty 14*167fd314SWill Schurman- (instancetype)initWithScopeKey:(NSString *)scopeKey 1544bbe92dSŁukasz Kosmaty{ 1644bbe92dSŁukasz Kosmaty if (self = [super init]) { 17*167fd314SWill Schurman _scopeKey = scopeKey; 1844bbe92dSŁukasz Kosmaty } 1944bbe92dSŁukasz Kosmaty 2044bbe92dSŁukasz Kosmaty return self; 2144bbe92dSŁukasz Kosmaty} 2244bbe92dSŁukasz Kosmaty 2344bbe92dSŁukasz Kosmaty- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler 2444bbe92dSŁukasz Kosmaty{ 25*167fd314SWill Schurman if ([EXScopedNotificationsUtils shouldNotification:notification beHandledByExperience:_scopeKey]) { 2644bbe92dSŁukasz Kosmaty [super userNotificationCenter:center willPresentNotification:notification withCompletionHandler:completionHandler]; 2744bbe92dSŁukasz Kosmaty } 2844bbe92dSŁukasz Kosmaty} 2944bbe92dSŁukasz Kosmaty 3044bbe92dSŁukasz Kosmaty@end 31