File tree Expand file tree Collapse file tree 4 files changed +15
-2
lines changed Expand file tree Collapse file tree 4 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,9 @@ export const App = () => {
184184 } else {
185185 // Do something else with push notification
186186 }
187+ // Use the appropriate result based on what you needed to do for this notification
188+ const result = PushNotificationIOS .FetchResult .NoData ;
189+ notification .finish (result);
187190 };
188191};
189192```
@@ -239,6 +242,9 @@ export const App = () => {
239242 const userText = notification .getUserText ();
240243 // Perform action based on textinput action
241244 }
245+ // Use the appropriate result based on what you needed to do for this notification
246+ const result = PushNotificationIOS .FetchResult .NoData ;
247+ notification .finish (result);
242248 };
243249};
244250```
Original file line number Diff line number Diff line change @@ -290,6 +290,7 @@ export const App = (): React.Node => {
290290 } ,
291291 ] ) ;
292292 }
293+ notification.finish('UIBackgroundFetchResultNoData')
293294 } ;
294295
295296 const onLocalNotification = ( notification ) => {
Original file line number Diff line number Diff line change @@ -169,7 +169,13 @@ - (void)handleRemoteNotificationRegistrationError:(NSNotification *)notification
169169
170170RCT_EXPORT_METHOD (onFinishRemoteNotification:(NSString *)notificationId fetchResult:(UIBackgroundFetchResult)result)
171171{
172- [self .remoteNotificationCallbacks removeObjectForKey: notificationId];
172+ if (self.remoteNotificationCallbacks ) {
173+ RNCRemoteNotificationCallback completionHandler = [self .remoteNotificationCallbacks objectForKey: notificationId];
174+ if (completionHandler) {
175+ completionHandler (result);
176+ }
177+ [self .remoteNotificationCallbacks removeObjectForKey: notificationId];
178+ }
173179}
174180
175181/* *
Original file line number Diff line number Diff line change 11{
22 "name" : " @react-native-community/push-notification-ios" ,
3- "version" : " 1.10.1 " ,
3+ "version" : " 1.11.0 " ,
44 "description" : " React Native Push Notification API for iOS" ,
55 "main" : " js/index.js" ,
66 "types" : " index.d.ts" ,
You can’t perform that action at this time.
0 commit comments