Open 4l3ss opened 19 hours ago
Thanks for the report, I'll see if I can reproduce and figure out the core issue here
Ok, was able to reproduce. Not really sure the fix yet but this is the order of things happening:
App starts:
Delegate method:
I am guessing we made a change and the order of swizzling changed. If firebase swizzled first I don't think we would have this issue.
Ok, some more findings:
We are unswizzling methods from the delegate when it changes, but there is no way to remove a method from a class, just add and replace. Since our empty delegate has no methods, it keeps the original swizzled method and causes the looping.
I believe we can address this on our end without a firebase change if we check to make sure the message receiver is the current notification delegate. If they do not match, and airship is called, it means the original did not have a method so we can no-op and break the cycle.
This is going to require a native SDK change which Ill try to get a patch together tomorrow. Once that is out then it takes a few more hours to get a react patch out.
Preliminary Info
What Airship dependencies are you using?
@ua/react-native-airship 20.0.0
What are the versions of any relevant development tools you are using?
react-native 0.74.6
Report
What unexpected behavior are you seeing?
When the app receives an airship notification, the app crashes with the following exception:
The problem disappears when removing the firebase messaging SDK, or when downgrading @ua/react-native-airship to 19.3.2
I understand the fix might not be on Airship side, but I'm filling an issue here for now because the wrong behavior appeared after upgrading the Airship SDK. Maybe it's a known issue ?
What is the expected behavior?
When tapping on a notification, the app should open without crashing.
What are the steps to reproduce the unexpected behavior?
It's a bit hard to setup from scratch. It seems it comes from incompatibilities between @react-native-firebase/messaging and @ua/react-native-airship.
Do you have logging for the issue?
When I receive the push and then tap on it :