Closed Qwin closed 1 year ago
I'm actually having the exact same issue, sporadic crashes on the same lines.
I'm seeing that same issue too - 77 occurences in 2 weeks, across different OS versions and phones. I'm not sure what's happening, or how to recreate it.
-[RNNotificationsStore completePresentation:withPresentationOptions:] RNNotificationsStore.m, line 60
That's the problem with me, I can never catch it in the act but it always happens when calling the completionHandler
. I've checked the timing and it shouldn't be timing out as there was 8 seconds in processing which is not enough to have the expiry timer being triggered.
I am also dealing with this issue for IOS, specifically related to the second crash report provided:
RNNotificationsStore completeAction:]_block_invoke + 2394552 (RNNotificationsStore.m:51)
The issue on my end frequently appears the first time a user receives a notification, but after the app crashes the issue seems to go away. Has anyone had any luck solving this?
Same error to me. i used react native 0.63.5 and react native notification 4.3.3 in debug mode ios crash when foreground notification. but it's okay to get notification in the background
do you have any idea?
I found out when I remove the completion callbacks the crash goes away.
I got the same crash (RNNotificationsStore.m:51) everytime I opened a notification from the background. Foreground notifications had no problems.
The app is deployed to Testflight, with v. 4.3.3 and react-native v. 0.70.5
With me it happens always on background notifications and if I remove the completion callback it still happens.
I found out when I remove the completion callbacks the crash goes away.
I got the same crash (RNNotificationsStore.m:51) everytime I opened a notification from the background. Foreground notifications had no problems.
The app is deployed to Testflight, with v. 4.3.3 and react-native v. 0.70.5
@hstorz removing the completion callback appears to be working on our end as well (when app is running in the background or not), thanks for sharing! Do you know why this resolves the issue? We haven't seen any yet, but have you experienced any other issues after removing the callback?
Just got this when testing, looks like the same thing:
I was running into this same problem and figured out it was caused by calling the registration methods on Notifications.events()
multiple times and then receiving a push notification. In my case, these event listeners were initialized inside a useEffect
hook that would re-trigger every time the app was backgrounded and then foregrounded. I solved it by moving the handlers to a useEffect
hook without any dependencies.
Example:
useEffect(() => {
Notifications.events().registerNotificationReceivedForeground(() => { ... });
... etc
},[]);
@brianarpie-forme if you need dependencies, you need to remove the subscription when component unmounted to avoid that scenario.
useEffect(() => {
const notification Notifications.events().registerNotificationReceivedForeground(() => { ... });
return () => {
notification.remove();
}
},[dependencies]);
Thanks @KhimGurung! I was having issues with the app reloading when I tapped a notification. Every time that happened the events would register again and I'd get many notifications displayed for each one sent. The .remove() fixes that.
Now I just have to figure out why it keeps reloading the app.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
I was running into this same problem and figured out it was caused by calling the registration methods on
Notifications.events()
multiple times and then receiving a push notification. In my case, these event listeners were initialized inside auseEffect
hook that would re-trigger every time the app was backgrounded and then foregrounded. I solved it by moving the handlers to auseEffect
hook without any dependencies.Example:
useEffect(() => { Notifications.events().registerNotificationReceivedForeground(() => { ... }); ... etc },[]);
Perfect, I could reproduce the crash as you mentioned by calling twice without the .remove() and then trying to open a notification.
And preventing two calls by using listener.remove()
fixed it.
Awesome, thank you so much! I think this issue can be closed as easily reproducible and fixable
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
The issue has been closed for inactivity.
Hello everyone, I am seeing this crash in Crashlytics, it's happening sporadically. Not sure why this is happening, just that its happening in (RNNotificationsStore.m:61) and (RNNotificationsStore.m:51).
here is the crash log
BUG IN CLIENT OF LIBDISPATCH: Unbalanced call to dispatch_group_leave()
And it happens here as well, seems to happen when removing key from handler dictionary.