File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ @implementation RCTOneSignalEventEmitter {
1010 BOOL _hasSetSubscriptionObserver;
1111 BOOL _hasSetPermissionObserver;
1212 BOOL _hasAddedNotificationClickListener;
13- BOOL _hasAddedNotificationLifecycleListener ;
13+ BOOL _hasAddedNotificationForegroundLifecycleListener ;
1414 BOOL _hasAddedInAppMessageClickListener;
1515 BOOL _hasAddedInAppMessageLifecycleListener;
1616 NSMutableDictionary * _preventDefaultCache;
@@ -264,7 +264,10 @@ + (void)sendEventWithName:(NSString *)name withBody:(NSDictionary *)body {
264264}
265265
266266RCT_EXPORT_METHOD (addNotificationForegroundLifecycleListener) {
267- [OneSignal.Notifications addForegroundLifecycleListener: self ];
267+ if (!_hasAddedNotificationForegroundLifecycleListener) {
268+ [OneSignal.Notifications addForegroundLifecycleListener: self ];
269+ _hasAddedNotificationForegroundLifecycleListener = true ;
270+ }
268271}
269272
270273RCT_EXPORT_METHOD (onWillDisplayNotification:(OSNotificationWillDisplayEvent *)event){
@@ -424,4 +427,4 @@ + (void)sendEventWithName:(NSString *)name withBody:(NSDictionary *)body {
424427 // iOS Stub
425428}
426429
427- @end
430+ @end
You can’t perform that action at this time.
0 commit comments