ios
ios copied to clipboard
iOS App running on iOS 14 crashes every-time new push comes #1569
Device iPhone X version- iOS 14 beta version.
App is crashing every time once new push come. anyone have solution for this.
Getting same issue, Can someone please check this , app is crashing on push only in iOS 14 getting this execption -
EXC_BREAKPOINTRNCPushNotificationIOS.m:273
drogonIOS/node_modules/@react-native-community/push-notification-ios/ios/RNCPushNotificationIOS.m:273:3 -[RNCPushNotificationIOS onFinishRemoteNotification:fetchResult:]
iOS 14 is released today, and we're experiencing this in our production app right now. I'll try to do some investigating myself and report back here, but I am generally unfamiliar with the implementation of push-notification-ios. Would appreciate any insight the rest of the community can provide on this crash.
The crash happens consistently when a push notification comes in on an iOS 14 device, in this code block (line 287 of RNCPushNotificationIOS.m):

It seems that the crash is related to this addition to AppDelegate.m required by the push-notification-ios's README:
// Required for the notification event. You must call the completion handler after handling the remote notification.
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{
[RNCPushNotificationIOS didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}
When I comment out [RNCPushNotificationIOS didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
, no crash occurs with iOS 14. But there may be unintended side effects? Maintainers and knowledgeable folks, please advise.
Here is the Xcode debug console output at the time of the crash:
2020-09-16 22:40:16.390423-0500 Skale[1427:180516] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}>
2020-09-16 22:40:16.390553-0500 Skale[1427:180516] [ProcessSuspension] 0x1175611c0 - ProcessAssertion: Failed to acquire RBS Background assertion 'WebProcess Background Assertion' for process with PID 1431, error: Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}
2020-09-16 22:40:16.397587-0500 Skale[1427:180516] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}>
2020-09-16 22:40:16.397667-0500 Skale[1427:180516] [ProcessSuspension] 0x117561240 - ProcessAssertion: Failed to acquire RBS Background assertion 'WebProcess Background Assertion' for process with PID 1431, error: Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}
2020-09-16 22:40:23.704512-0500 Skale[1427:180688] [connection] nw_read_request_report [C8] Receive failed with error "Software caused connection abort"
2020-09-16 22:40:23.710848-0500 Skale[1427:180688] [connection] nw_read_request_report [C23] Receive failed with error "Software caused connection abort"
2020-09-16 22:40:23.711262-0500 Skale[1427:180688] [connection] nw_read_request_report [C15] Receive failed with error "Software caused connection abort"
2020-09-16 22:40:23.711968-0500 Skale[1427:180688] [connection] nw_read_request_report [C14] Receive failed with error "Software caused connection abort"
2020-09-16 22:40:23.715756-0500 Skale[1427:180688] [connection] nw_read_request_report [C21] Receive failed with error "Software caused connection abort"
2020-09-16 22:40:23.716220-0500 Skale[1427:180688] [connection] nw_read_request_report [C17] Receive failed with error "Software caused connection abort"
2020-09-16 22:40:23.750165-0500 Skale[1427:180688] Connection 1: received failure notification
2020-09-16 22:40:23.750264-0500 Skale[1427:180688] [connection] nw_flow_add_write_request [C1 192.168.1.113:8081 failed channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] cannot accept write requests
2020-09-16 22:40:23.750310-0500 Skale[1427:180688] [connection] nw_write_request_report [C1] Send failed with error "Socket is not connected"
2020-09-16 22:40:23.773660-0500 Skale[1427:180688] Connection 16: received failure notification
2020-09-16 22:40:23.773720-0500 Skale[1427:180688] [connection] nw_flow_add_write_request [C16.1 52.205.86.27:443 failed channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] cannot accept write requests
2020-09-16 22:40:23.773755-0500 Skale[1427:180688] [connection] nw_write_request_report [C16] Send failed with error "Socket is not connected"
2020-09-16 22:40:23.774000-0500 Skale[1427:180688] Connection 18: received failure notification
2020-09-16 22:40:23.774857-0500 Skale[1427:180688] [connection] nw_flow_add_write_request [C18.1 52.205.86.27:443 failed channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] cannot accept write requests
2020-09-16 22:40:23.775031-0500 Skale[1427:180688] [connection] nw_write_request_report [C18] Send failed with error "Socket is not connected"
2020-09-16 22:40:23.775966-0500 Skale[1427:180688] Connection 19: received failure notification
2020-09-16 22:40:23.776011-0500 Skale[1427:180688] [connection] nw_flow_add_write_request [C19.1 52.205.86.27:443 failed channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] cannot accept write requests
2020-09-16 22:40:23.776042-0500 Skale[1427:180688] [connection] nw_write_request_report [C19] Send failed with error "Socket is not connected"
2020-09-16 22:40:23.777389-0500 Skale[1427:180688] Connection 20: received failure notification
2020-09-16 22:40:23.778188-0500 Skale[1427:180688] [connection] nw_flow_add_write_request [C20.1 52.205.86.27:443 failed channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] cannot accept write requests
2020-09-16 22:40:23.778458-0500 Skale[1427:180688] [connection] nw_write_request_report [C20] Send failed with error "Socket is not connected"
2020-09-16 22:40:23.778798-0500 Skale[1427:180688] Connection 24: received failure notification
2020-09-16 22:40:23.778835-0500 Skale[1427:180688] [connection] nw_flow_add_write_request [C24.2 20.185.73.23:443 failed channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] cannot accept write requests
2020-09-16 22:40:23.778864-0500 Skale[1427:180688] [connection] nw_write_request_report [C24] Send failed with error "Socket is not connected"
2020-09-16 22:40:23.781361-0500 Skale[1427:180688] Connection 27: received failure notification
2020-09-16 22:40:23.783075-0500 Skale[1427:180688] [connection] nw_flow_add_write_request [C27.1 20.185.73.23:443 failed channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] cannot accept write requests
2020-09-16 22:40:23.783238-0500 Skale[1427:180688] [connection] nw_write_request_report [C27] Send failed with error "Socket is not connected"
2020-09-16 22:40:23.783869-0500 Skale[1427:180688] Connection 13: received failure notification
2020-09-16 22:40:23.783911-0500 Skale[1427:180688] [connection] nw_flow_add_write_request [C13 192.168.1.113:8081 failed channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] cannot accept write requests
2020-09-16 22:40:23.783943-0500 Skale[1427:180688] [connection] nw_write_request_report [C13] Send failed with error "Socket is not connected"
2020-09-16 22:40:23.798754-0500 Skale[1427:180688] Connection 11: received failure notification
2020-09-16 22:40:23.798826-0500 Skale[1427:180688] [connection] nw_flow_add_write_request [C11 192.168.1.113:8081 failed channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] cannot accept write requests
2020-09-16 22:40:23.798865-0500 Skale[1427:180688] [connection] nw_write_request_report [C11] Send failed with error "Socket is not connected"
2020-09-16 22:40:23.801061-0500 Skale[1427:180688] Connection 22: received failure notification
2020-09-16 22:40:23.801110-0500 Skale[1427:180688] [connection] nw_flow_add_write_request [C22 192.168.1.113:8081 failed channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, ipv6, dns)] cannot accept write requests
2020-09-16 22:40:23.801142-0500 Skale[1427:180688] [connection] nw_write_request_report [C22] Send failed with error "Socket is not connected"
@saurabh874 @San10694 the workaround I'm currently deciding on is to comment out line 287 of RNCPushNotificationIOS.m (completionHandler(result);
). This allows the app to receive push notifications while avoiding crashes and keep the ability to trigger local notifications. There may still be some side effects that I'm not aware of; perhaps a maintainer can provide some insight?
Same issue
same issue, any update?
did anyone manage to solve it?
https://github.com/react-native-community/push-notification-ios/issues/163#issuecomment-693818811 This workaround works for me but I suppose no new update
@saurabh874 @San10694 the workaround I'm currently deciding on is to comment out line 287 of RNCPushNotificationIOS.m (
completionHandler(result);
). This allows the app to receive push notifications while avoiding crashes and keep the ability to trigger local notifications. There may still be some side effects that I'm not aware of; perhaps a maintainer can provide some insight?
Work around also worked for me.
I am facing the same issue on react native 0.63.3
, ios 14.0.1
.
I am noticing this too on my app since ios 14
Hello! I'm trying to address this issue with my iOS14 device, but I'm unable to reproduce the issue. onFinishRemoteNotification mentioned in comment https://github.com/react-native-push-notification-ios/push-notification-ios/issues/163#issuecomment-693797255 seems to be called fine on my side.
Would someone be able to create a reproduction repo for this issue?
@Naturalclar Yes Still we are facing same issue. and this issue is come only when app is in foreground.
Hello! I'm trying to address this issue with my iOS14 device, but I'm unable to reproduce the issue. onFinishRemoteNotification mentioned in comment #163 (comment) seems to be called fine on my side.
Would someone be able to create a reproduction repo for this issue?
You only need device on ios 14 and app in foreground receiving push
I'm using a physical iOS 14.1 device (iPhone 7) tried both local notification and push notification (using Pusher), tried both foreground and background but the notification seems to work fine. I'm using the example app in this repo.
It will help if some one can provide a repository that will reproduce the crash so I could investigate further :)
Hi @Naturalclar it will very helpful if you to comment out line 287 of RNCPushNotificationIOS.m (completionHandler(result);) because i comment out this line and it is perfectly working.
tried on fresh RN 0.63.3 with GCM push notification - crash on every device with iOS 14+, maybe push provider is the reason
btw on simulator push notifications works perfect even in foreground, got crash only in test flight and production
Any updates? I'm also getting this on RN 0.59.9, iOS 14+, iPhone12,3
I have same issue, commenting completionHandler(result)
is not safe solution.
Also having the same issue on RN 0.61.4, iOS 14+. Was able to resolve by commenting the line recommended above, but following to see if the issue is resolved.
I've released 1.7.5-beta.0
with potential fix for this.
I wasn't able to reproduce the crash with the original package, so could someone verify that this change fixes the crash?
Sorry, 1.7.5-beta.0 didn't fix my problem.
After commenting out completionHandler(result)
like before, crash didn't occur

released v1.8.0 that should fix the issue
Thanks @Naturalclar! Can you share what was the issue, and why moving completionHandler() resolves it?
can confirm, version 1.8.0 not crashing anymore, but foreground push is not visible (event is firing)
@tmmgn I'm using PushNotificationIOS.presentLocalNotification
for iOS instead of PushNotification.localNotification
, maybe it can resolve your problem.
I realized now, presentLocalNotification seems deprecated. I suppose, suggested new function is addNotificationRequest
I was facing the same problem in one of my projects, it seems that Apple has changed some very important aspects of Push notifications which affected many apps out there. It was possible to fix this issue following the steps posted by the user "edelabar_pmd" on their official forum: https://developer.apple.com/forums/thread/660149
Although after following the changes in the link above I found out that all these errors were gone for users running the app on iOS 14.2. I imagine it could be a very strong lead to first try building the app in this version before trying to change anything in the code (as this probably seems to be Apple's mistake, not the library's).
if you use RN 0.63.2 and fire-base ver 5.6.x Please follow the following link. It worked for me !!!! ios 14 tap push crash