-
-
Notifications
You must be signed in to change notification settings - Fork 468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS Crash Reports #385
Comments
Crash #1 stacktrace indicates the crash arises here when calling Similarly Crash #2 seems to arise here which is a similar call to Does it seem to be a specific notification message that caused the crash? |
I have like 5 "Background" Threads per Crash that are included in the Crash Report. Should i post them here as well? Our Push Notifications are all very similar, where the body is a JSON that includes a pushCode and a title, which the App handles. I know on which Push the App crashed at my chef, but i don't think it is very different from the others. It's JSON with these Keys:
|
Oh yeah, so this JSON i mentioned is the In the |
The For example, if you specified a custom sound file that did not exist within your app, that could lead to a native crash. So I'd need to see the full FCM message structure in order to investigate further. How are you sending the notification message? Are you using the FCM v1 API? If so, try using the built-in messaging client in the example project to send your message as this uses the Firebase Admin SDK which carries out validation on the message structure. |
Our Backend is written in Scala currently and uses the normal Java Api: "com.google.firebase" "firebase-admin" "6.11.0" This specific Push is send two Times (One Notification Push ( val builder = ApnsConfig
.builder()
.putHeader("apns-priority","10")
// the data JSON i mentioned before
.putAllCustomData(keyValue.mapValues(_.asInstanceOf[Object]).asJava)
.setAps(getAps(notificationPush).build())
builder.build()
// the getAps() does this:
val builder = Aps.builder()
if (notificationPush) {
builder.setAlert("") // some string
builder.setSound("companionship_request_sound.caf")
builder.setBadge(badge) // some badge value
builder.setCategory("companionship request")
builder.setContentAvailable(false)
} else {
builder.setContentAvailable(true)
} When the App doesn't crash it plays the Sound so the Soundfile is available |
Without an exact notification message values that can be used to replicate the exact same scenario, it's impossible for me to identify the cause of your crash. My suggestion is to play with your notification generation code (e.g. with/without content-available) to try to reliably reproduce the crash and identify the bad value. |
Okay i understand what you're saying, but if the Message is the Problem, shouldn't the App crash every time the Push is received? |
As demonstrated in the code references above, the code entry points in the plugin are wrapped in try/catch statements to try to catch and handled exceptions to prevent them cascading upwards to cause an app crash. There is an open feature issue to add message payload validation to the plugin to prevent this kind of bad data reaching the native notification center but implementing this will be a fair amount of work. |
@dpa99c While using this plugin, there is some issue while submitting the app to the App store, the issue is related the 'uiwebview deprecated ios'. Can you suggest |
@dpa99c we are also seeing these crashes since our last app update.
and
Using firebasex@8.0.1 We transfered the app from one iOS developer team to another - in that process also changed APN keys etc.. Could this be related to the cause of the crash? |
I've had no reports of such crashes in my production apps using this plugin and been unable to repro it using the example project. So what's needed is a reliable test case that can reproduce these crashes (ideally within the example project) or more detailed information about the crashes on user devices (e.g. is it limit to specific iOS versions or devices). Without such information it's not possible to narrow down the cause of the crashes. |
FYI: We updated to 9.1.1 and are still seeing these crashes
I know there is no way for you to fix this without proper reproduction. I will inform you once I know more. |
I was providing wrong information here. We were using 6.1.0 before without problems. Since 8.0.1 the bug appears. |
@capc0 thanks for the update. I think it's fairly likely that the crashes are being caused by a particular value being passed into |
same issue. -[AppDelegate(FirebasePlugin) userNotificationCenter:willPresentNotification:withCompletionHandler:] + 389 -[AppDelegate(FirebasePlugin) userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:] + 455 -[AppDelegate(FirebasePlugin) userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:] + 460 |
I am still unable to reproduce this issue. All the info I have so far:
Here is some of the code I use: Sending notifications in my NodeJS backend via
In my mobile app project I log the messages via and do not do anything else with them
the XCode log show the following native log (I changed the message id and sender id numbers)
possibly related issues from other projects using firebase push notifications
I dont know if this helps at all, but thats all I can get for now. |
@capc0 thank you for the information. App crashes are caused in the following situations:
|
@eun-choi thanks for the additional info. Sounds like it will be hard to reproduce reliably but I will have a go when I get a bit of time. |
Hi! I'm facing the same issue, when I'm sending a push notification via the Firebase console or https://cordova-plugin-fcm.appspot.com/. It's happening to 30% of my users. Here's my crash log:
Versions
Just wanted to inform you that more people are having this issue :) Thanks for the awesome plugin! |
I thought it's about new versions but i got same errors with downgrade (7.0.1 & 8.0.1). Crash rate is %1.5 due to Firebase. |
Any thoughts on how to work-around this issue? |
I never had such issues with cordova-plugin-firebase but after switching to cordova-plugin-firebasex so far single crash occurred (app is still in a test phase). Versions:
Crash log:
Here is JSON sent to FCM:
|
Hi, Do you have any news about this problem? We encounter the same error on multiple devices. It happens always at the first notification after app update through TestFlight (crash). We tested to send notification from our server first (app in foreground only) => Crash Tested with FirebaseX 8.0.1 and 10.1.0-cli. Thanks in advance. (Ionic info below)
|
I'm wondering if it could have something to do with: OneSignal/OneSignal-Cordova-SDK#648 For me it started happening when I mixed both plugins together. I'm just not even able to reproduce this myself, but users ~10% on iOS seem to be having this crash upon tapping a push. Could it be an incompatibility with the OneSignal plugin? |
@HansKrywaa definitely helpful. Not sure why the |
Yes. If i kinda Update the App (just increase the Build Number) it always happen to me again. The Notification Object is:
The Content of this Notification is:
I set a Breakpoint in Line 397: |
OK thanks, that's probably enough info that I can repro the crash. |
I've had a quick look and I still can't recreate the issue but I think the commit that's responsible for introducing it is this: 4e9a0f4 Somehow this is leading to the delegate referencing itself leading to infinite recursion. |
I have once the error in debug mode too and as @HansKrywaa explained, and I can confirm the loop on the breakpoint. @dpa99c , the change you specified make sense. I'm not an expert iOS but is it normal to keep the "initial delegate" : See line 58 ? Maybe, we try to call this "null" delegate and it loops from here. Kr. |
While @dpa99c needs more time for investigation, do we have any workaround to prevent the crashes? Since my last release with the addition of firebasex for Analytics, the crash rate in ios is getting up to 1.3%. It happens always at the receiving of first notification after app updates through TestFlight (crash). After app restarts, it works all fine.
|
it's a good news :) |
Awesome! 🎉 Please release as fast as possible so we can include it in our next release! |
@dpa99c I'm afraid app still crashes when clicking on notification during first run after update. Please see below crash logs:
|
@switchstance-devs that sucks 😞 - just to double-check, you definitely installed the plugin off the master git branch ( I still wasn't able to repro this crash in a debug build in Xcode so I added defensive coding based on @HansKrywaa's stacktrace but seems the infinite recursion is still happening so I might need to do something differently than the original commit which added this delegate switching code. There might be a better solution to make this work with cordova-plugin-local-notifications in the same project and still prevent this crash, e.g. a common broadcast event (see #443 and katzer/cordova-plugin-app-event#16). |
@dpa99c Yes, I completely reinstalled the plugin and used the master branch. @HansKrywaa Would you be able to verify if you're still experiencing the same issue? |
…iOS" Upon testing, this plugin does not work with `cordova-plugin-local-notification` present in the same project even with this code in place. Therefore removing it should stop the crashes occurring in #385. And the conflict between the 2 plugins will need to be addressed separately under #230. This reverts commit 4e9a0f4: > co-existence with cordova-plugin-local-notification on iOS > Local notifications on iOS via cordova-plugin-local-notification are working again. >Click-callback for remote notifications not working right now. >Details: >UNUserNotificationCenter accepts a single delegate that handles the display of notifications. cordova-plugin-firebase now stores a reference to the existing delegate if any and proxies the delegate-calls (cordova-plugin-local-notification is >already doing that in the other direction when applicable).
I've just done some testing regarding this: Firstly, if you add the current version of cordova-plugin-local-notification to your Cordova project alongside this one, then foreground notifications stop working properly as outlined in #230. The original commit that added the delegate swizzling (which I believe is responsible for these crashes) was intended to fix this so both plugins could co-exist. If someone can give that branch a test and let me know if it stops the crashes, I'd be grateful. To test it in your project:
|
@dpa99c Thanks, i will test the next days. 😊 We are using the Local Notifications Plugin as well, but because in our logic local Notifications only fired in Background we never got the error #230. So if i understand correctly, this error will be "back" then? Doesn't important for us and i don't know how much work this will be, but do you thought about including the option to trigger local pushs into this plugin to work next to the core functionality ? |
Just installed from dev Branch and i was not able to reproduce this Crash - but i have this Problem with local Pushs now: i send them in the background and want to perform specific things when i click into it. For this i use the |
@dpa99c I installed the plugin from dev branch and I can confirm no crash happens when clicking on notification as described for original issue. |
We were seeing the same crashes in testing, and now with the dev build we can confirm it is resolved as well. (Nice work!) We are on the cusp of an releasing our app, and are wondering when this will be included in a release of the plugin? |
The fix has been merged from dev to master and published as |
Bug report
We just released our iOS App yesterday and received some Crashes, which seems to be related to this Plugin.
Current behavior:
Crash 1
-[AppDelegate(FirebasePlugin) userNotificationCenter:willPresentNotification:withCompletionHandler:]
AppDelegate+FirebasePlugin.m, line 389
SIGBUS
Crash 2
-[AppDelegate(FirebasePlugin) userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:]
AppDelegate+FirebasePlugin.m, line 455
SIGBUS
As the second Crash happened to my Chef, i can told you what he told me: A Push appeared, he clicked on it -> App Crash.
The "Stack Traces" doesn't seem to be very helpful, so if i can give you any more information, please told me which.
Environment information
9.0.0 (cordova-lib@9.0.1)
ios 5.1.1
Runtime issue
The text was updated successfully, but these errors were encountered: