-
Notifications
You must be signed in to change notification settings - Fork 4k
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
[firebase_messaging] Enable compatibility with other notification plugins #1829
Conversation
…be handled when swizzling is disabled
… messages from firebase
Just to add a note that I didn't update the example app use the |
…unch is only triggered for a notification coming from FCM
…e found within an application's iOS project
Any ETA when this one will be reviewed and merged? |
If it's urgent, you could try referencing my fork in your app. See https://dart.dev/tools/pub/dependencies#git-packages in case you haven't referenced packages via git before. Would help knowing if it helps resolve issues for others as well beyond the testing I've done |
@MaikuB thanks! But I still not able to receive message and show local push notification when ios app is off, even with changes from your repo. I update my pubspec with repo ref:
also I add line to infoPlist:
To send msg I am using next cmd:
So,
|
@pro100svitlo can you post issues on my fork so we can make the PR thread for others easier to follow? |
done 👌 |
Thank you for the fix. On both iOS and Android it works for me now. I had to make a nother change though.
I have tested the various app states on both iOS and Android and together with your fork the change doesn't seem to cause any issue. Maybe you can include it into this PR. |
I thought Androids were supposed to dismiss notifications of apps on-screen. As logn as the callback is run, the user shouldn't have to have another notification in their tray. |
@Levi-Lesches not sure about Android. This was about iOS and there you normally have to remove them manually as a developer. @MaikuB thank you, didn't see that one. |
I'm not a top developer and surely not part of a big team such as Flutter... but is there a reason why @collinjackson or @kroikie haven't looked at this PR yet? it's been 27 days now and there's many of us waiting to include this plugin in our projects. imo it doesn't take more than a couple hours max to just take a look at the PR. Not looking to sound rude here, I'm just curious of how busy can they be! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for the contribution! I made some small changes to the CHANGELOG
. I removed the breaking changes notes since the is essentially a bug fix. I'll merge once analyze tests pass once again!
Sure thing. I was told on discord that infrastructure changes were going to be done before this could be looked though I don't know if that was with regards to do with priorities/timr or if those changes would help testing PRs like this one |
Yea, @collinjackson and I talked offline and there is new testing infrastructure that would allow us to test this on CI, but this issue is blocking many people so I wanted to go ahead and submit it. We can currently test this locally, but we still need to set things up to test it on CI. |
Description
Compatibility issues have been reported with
firebase_messaging
and other notification plugins (e.g.flutter_local_notification
). When both are used in an application, their callbacks may be clobbered.Users have also recently reported that push notifications were not working since recent changes had mentioned in the readme that the
AppDelegate
must be modified to register theUNUserNotificationCenterDelegate
. However, this causes problems as FCM uses method swizzling. The readme has been updated as part of this change to indicate that registering theUNUserNotificationCenterDelegate
should only be done when method swizzling is disabled, which should fix this issue as well.Related Issues
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.///
).flutter analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?