Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Add Android messageId to enable integration with react-native-firebase/messaging#1510

Merged
Dallas62 merged 2 commits into
zo0r:devfrom
Adapptor:message-id
Jul 16, 2020
Merged

Add Android messageId to enable integration with react-native-firebase/messaging#1510
Dallas62 merged 2 commits into
zo0r:devfrom
Adapptor:message-id

Conversation

@aranda-adapptor
Copy link
Copy Markdown
Contributor

@aranda-adapptor aranda-adapptor commented Jul 7, 2020

This PR is part of the solution to the following problem:

  • Using @react-native-firebase/messaging for delivery and handling or remote messages and notifications when the app is killed or in the background
  • Using react-native-push-notification to display these notifications when the app is in the foreground
  • Tapping on a push that arrived in the foreground opens the app but does not send the payload through to RN firebase messaging().getInitialNotification or messaging().onNotificationOpenedApp

RN firebase messaging stores the remote notification payload and looks it up based on this "message_id" intent extra. The full solution requires minor changes to RN firebase too, which will be submitted as another PR soon.

Copy link
Copy Markdown

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I help maintain react-native-firebase and just reviewed the corresponding change in that repo. As mentioned there, I can't see how this would be harmful - at least in our repo - and the value is obvious. I approved it there but I'm just one vote and I may have missed something. Just wanted to comment here that it seems like a useful capability and I like the idea, for what it's worth. Cheers

@Dallas62 Dallas62 self-assigned this Jul 7, 2020
@mikehardy
Copy link
Copy Markdown

The related PR in react-native-firebase has passed the required number of reviews, so it will merge just pending @aranda-adapptor signing the CLA there, so as this is a cross-package PR basically, just keeping you guys up to date that this is good on our end. Cheers

@Dallas62
Copy link
Copy Markdown
Collaborator

Hi @aranda-adapptor
Thanks for this PR !
Changes looks good for local notification, but it' probably not working for Scheduled Notification.
Changes should be made in this file:
https://github.com/zo0r/react-native-push-notification/blob/dev/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationAttributes.java
Once it's done, This PR will be OK for merging.

@Dallas62 Dallas62 merged commit 8019f42 into zo0r:dev Jul 16, 2020
@Dallas62
Copy link
Copy Markdown
Collaborator

Will add the change for Scheduled notifications, thanks !

@aranda-adapptor
Copy link
Copy Markdown
Contributor Author

@Dallas62 thanks for finishing that off, I was on vacation and it would've taken a little while to figure out the required changes 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants