-
Notifications
You must be signed in to change notification settings - Fork 16
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
App crash when opening notification #557
Comments
Hi @tharro, thanks for reporting this. Would you be able to share an example project with some instructions on how to reproduce the issue? |
Hey @lawrence-forooghian, I’m experiencing the same issue. I don’t use the Ably push notification service (it’s disabled), and I have the FCM service used elsewhere in my application. I’m not sure what’s causing this problem, but I can share part of my crash log if that helps.
|
Hi @erdemtas-kollekt, thanks for letting us know. Are you able to reproduce the issue? |
Hi @lawrence-forooghian, the issue consistently occurs after I tap a notification sent to my app via FCM. So yes I can reproduce the issue. However, it is not related to Ably in any way. I am ready to provide any necessary information to help resolve this issue. |
Can anyone provide a status or fix/closure to this issue? I've had a customer report "an app crash" related to push notifications which started after they added our ably_flutter-based SDK to their App. We use ably_flutter 1.2.36, but we don't do anything with or reference anything in our SDK to do with ably's Push Notifications support. Curious if your push notifications code could be causing a host-app crash as this issue above is describing? |
@jhgroenjes This is now under investigation. Do they use FCM for push notifications? If yes, what version? I tried an example app in this repo with Firebase SDK (15.2.1) and Cloud Messaging and haven't experienced any crashes yet. UPD: tried with |
@erdemtas-kollekt Couldn't you tell what versions of iOS, Firebase and Flutter is being used in your project? And after what action you've started to experience this issue? |
I've asked for those details from the customer. They develop the Host app, we provided the SDK that uses ably_flutter. They reported Push Notifications issues (host app crashes) after installing our SDK. They discovered this ably_flutter issue log and said it's exactly what they're experiencing. KrowdKinect only uses websockets functionality from ably_flutter, but I believe you all have Push Notifications support within that plugin. Is there anyway its presence or the process of installing your plugin could impact the pre-existing PN handling within the host app? I'll confirm versions you asked for with the customer and report back. |
Yes, ably_flutter intercepts user's push delegate and process pushes internally. Here is an attached to this issue PR that allows user to bypass this behavior, but we keen to find out the exact reason of the crash, so any help is appreciated. Meanwhile you can try this PR's branch for your library. |
Wait. So you're saying that an unused, unactivated and even unknown feature in your websockets SDK is actively intercepting the delegate for push notifications? Is there a reason this obtrusive behavior is Ably's default on a websockets-only use of the SDK? Is this true only of your flutter SDK or all other SDK platforms as well? We'll review the workaround you referenced, but do you intend a release that reverses this default behavior? (Assuming I understood your comments correctly). |
Hey @maratal, I recently started using Ably, and this issue occurred after the initial setup. If you're wondering when it happens—the app receives notifications without any problems through FCM (not related to Ably), but tapping on a notification causes a crash. The issue occurs on both Android and iOS. In our app (Flutter version: 3.24.5, Ably version: 1.2.23, firebase_core: 3.1.0, firebase_messaging: 15.0.1) |
@jhgroenjes It's a default behavior for Ably Flutter. I wasn't the one who implemented this, but my guess would be that no one expected that users will use push notifications somewhere else. Firebase does something similar - your need to explicitly opt-out their interception of user's delegate (in both cases libraries still call users methods). |
Understood. I'll review the PR to implement a fix in our SDK. I'll also post details here once known from the customer as to their flutter / FCM versions or other experiences to help you with identifying root cause |
@maratal Can you add clarification to #560 as to how to implement your intended fix in a flutter Plugin project? I only want ably_flutter to be used at the Dart layer of my Plugin project to receive websockets messages. Nothing else. I'm led to believe by issue #557 and PR 560 that I still must somehow "disable" push notifications support in your ably_flutter SDK so that it doesn't interfere with the Host Apps (that already have push notifications working at the Host App layer) when they install my SDK. My SDK is now using the commit hash listed in the PR, but it would appear you're ENABLING push notifications support by default in that PR. ?? Hence why I'm posting here for clarity on what configuration changes may still be needed to get ably_flutter "out of the way" when Host Apps install our SDK (which uses ably_flutter only for websockets). The Host App developer shouldn't need to make any changes. Host Apps won't have any knowledge our SDK uses ably_flutter. The fix I need from you must be applied either in your ably_flutter SDK itself, or that, plus some other configuration change I must make to turn off your default behavior of interfering with Push Notifications at the Host App layer. Thanks! |
Correct, currently authors of the app should add |
Flip the logic? Keep ably_flutter quiet and minding its own business, doing absolutely nothing after being installed. Developers then must choose to declaratively Enable features one-by-one as they desire them. I don't desire push notifications, yet your current logic not only forces that on framework developers, it's crashing host apps too as we had no idea it was enabled by default. Just a thought. Thank You!! I have a customer in wait with a crashing app until you find a resolution here please. |
@jhgroenjes I've updated so library doesn't interfere with APNs by default due to your urgency, but keep in mind that this PR is still in a draft state (and until a proper solution will be found). |
@maratal awesome. you rock. So to confirm, (814ed15...) is the right one? And, there's nothing else to configure other than ensure my SDK Framework imports this commit hash as the ably dependency? Asked differently, I don't need to change my code or apply any additional configurations at all to remove your push notifications features? - just use branch: fix/557-opt-out-push-handler? I understand the next main release will need to be handled differently, perhaps, deeding on how you land on a permanent resolution to this. Again, Thank you. |
Correct, commit 814ed15 also correct. Let me know if it fixed user's issue. Thank you for feedback! |
frame #0: 0x0000000180aa5c18 CoreFoundation
__CFStrAllocateMutableContents CoreFoundation
:-> 0x180aa5c18 <+0>: stp x20, x19, [sp, #-0x20]!
0x180aa5c1c <+4>: stp x29, x30, [sp, #0x10]
0x180aa5c20 <+8>: add x29, sp, #0x10
0x180aa5c24 <+12>: add x8, x0, #0x8
dependencies:
ably_flutter: ^1.2.35
firebase_core: ^2.12.0
firebase_messaging: ^14.6.0
firebase_analytics: ^10.4.0
firebase_crashlytics: ^3.3.0
flutter_local_notifications: ^17.2.1
device_info_plus: ^10.0.1
In android/src/main/AndroidManifest.xml
In iOS/AppDelegate.swift
┆Issue is synchronized with this Jira Task by Unito
The text was updated successfully, but these errors were encountered: