Payload as map#277
Closed
josh-burton wants to merge 3 commits into
Closed
Conversation
Owner
|
FYI that one of the members of the Flutter team is looking into the issue and in fact has a PR that pending approval. As such, I don't think this PR is necessary |
Contributor
Author
|
Great! Do you have a link? |
Owner
|
flutter-team-archive/engine#9864 It's referenced in the issue I created on the Flutter repository around this |
|
please reopen |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've implemented these changes so I can receive both Firebase messages and local notifications with the onSelected callback in my app.
This PR is to open a discussion around these changes and whether it might be something that should be merged.
Basically, because of the known issue around not being able to have multiple notification delegates on iOS,
local notificationsoverrides Firebase Messaging callbacks.When clicking on a Firebase notification, local notifications still gets invoked, but it only extracts and passes the payload back to the onSelected callback. A Firebase notification doesn't have a payload so the payload is null.
By passing back the userInfo dictionary, we can extract the payload on the dart side and add an extra parameter to onSelected which is all the (firebase) data from the notification - it allows the user to handle both Firebase and local notifications.
Android doesn't have the same problem (I think) so the payload is just passed back but within a map.