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 = () => {
184
184
} else {
185
185
// Do something else with push notification
186
186
}
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);
187
190
};
188
191
};
189
192
```
@@ -239,6 +242,9 @@ export const App = () => {
239
242
const userText = notification .getUserText ();
240
243
// Perform action based on textinput action
241
244
}
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);
242
248
};
243
249
};
244
250
```
Original file line number Diff line number Diff line change @@ -290,6 +290,7 @@ export const App = (): React.Node => {
290
290
} ,
291
291
] ) ;
292
292
}
293
+ notification.finish('UIBackgroundFetchResultNoData')
293
294
} ;
294
295
295
296
const onLocalNotification = ( notification ) => {
Original file line number Diff line number Diff line change @@ -169,7 +169,13 @@ - (void)handleRemoteNotificationRegistrationError:(NSNotification *)notification
169
169
170
170
RCT_EXPORT_METHOD (onFinishRemoteNotification:(NSString *)notificationId fetchResult:(UIBackgroundFetchResult)result)
171
171
{
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
+ }
173
179
}
174
180
175
181
/* *
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @react-native-community/push-notification-ios" ,
3
- "version" : " 1.10.1 " ,
3
+ "version" : " 1.11.0 " ,
4
4
"description" : " React Native Push Notification API for iOS" ,
5
5
"main" : " js/index.js" ,
6
6
"types" : " index.d.ts" ,
You can’t perform that action at this time.
0 commit comments