@@ -86,6 +86,15 @@ - (id)init {
8686 name: kJPFOpenNotification
8787 object: nil ];
8888
89+ [defaultCenter addObserver: self
90+ selector: @selector (openNotificationToLaunchApp: )
91+ name: kJPFOpenNotificationToLaunchApp
92+ object: nil ];
93+
94+ if ([RCTJPushActionQueue sharedInstance ].openedLocalNotification != nil ) {
95+ [[NSNotificationCenter defaultCenter ] postNotificationName: kJPFOpenNotificationToLaunchApp object: [RCTJPushActionQueue sharedInstance ].openedLocalNotification];
96+ }
97+
8998 return self;
9099}
91100
@@ -94,11 +103,11 @@ - (void)reactJSDidload {
94103 [[RCTJPushActionQueue sharedInstance ] scheduleNotificationQueue ];
95104
96105 if ([RCTJPushActionQueue sharedInstance ].openedRemoteNotification != nil ) {
97- [[NSNotificationCenter defaultCenter ] postNotificationName: kJPFOpenNotification object: [RCTJPushActionQueue sharedInstance ].openedRemoteNotification];
106+ [[NSNotificationCenter defaultCenter ] postNotificationName: kJPFOpenNotificationToLaunchApp object: [RCTJPushActionQueue sharedInstance ].openedRemoteNotification];
98107 }
99108
100109 if ([RCTJPushActionQueue sharedInstance ].openedLocalNotification != nil ) {
101- [[NSNotificationCenter defaultCenter ] postNotificationName: kJPFOpenNotification object: [RCTJPushActionQueue sharedInstance ].openedLocalNotification];
110+ [[NSNotificationCenter defaultCenter ] postNotificationName: kJPFOpenNotificationToLaunchApp object: [RCTJPushActionQueue sharedInstance ].openedLocalNotification];
102111 }
103112
104113}
@@ -126,6 +135,11 @@ - (void)setBridge:(RCTBridge *)bridge {
126135 }
127136}
128137
138+ - (void )openNotificationToLaunchApp : (NSNotification *)notification {
139+ id obj = [notification object ];
140+ [self .bridge.eventDispatcher sendAppEventWithName: @" OpenNotificationToLaunchApp" body: obj];
141+ }
142+
129143- (void )openNotification : (NSNotification *)notification {
130144 id obj = [notification object ];
131145 [self .bridge.eventDispatcher sendAppEventWithName: @" OpenNotification" body: obj];
0 commit comments