Skip to content

Not getting _data object in onNotificationOpened during foreground #3005

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

Closed
Murugeshrockey-RN opened this issue Dec 15, 2019 · 3 comments
Closed

Comments

@Murugeshrockey-RN
Copy link

Platform: Android and IOS

Lib Package Version: "react-native-firebase": "^5.5.6",

React Native Version: "react-native": "0.60.5",
CODE:
this.notificationOpenedListener = firebase.notifications().onNotificationOpened((notificationOpen) => {
console.log('output',notificationOpen)
});
Here the input send from backend side.

URL:https://fcm.googleapis.com/fcm/send
Input: {
"to":"c9kHZZSbReU:APA91bHafZuEi7JrDFM5WrGUHLl4MPrbBd6T_XwauMz5ff-cGViOfrJ8AYSn_pgOh-01-F56Nc0qxlfXZwsS5chZo7uBVOdNM8_g9i1S_f8Nr0XI-Iv6t0oN0LvrkPVRfruXwOm7LstE",
"data" : {
"body" : "Welcome to Zark",
"title": "Zark Gaming",
"target_screen":"notification"
},
"notification" : {
"body" : "Welcome to Zark",
"title": "Zark Gaming"
}
}

Getting payload data on onNotificationOpened when tap the notification when app is from background but not getting payload data when tap the notification from foreground. So I can't able pass the data or setting target_screen during foreground.

@mikehardy
Copy link
Collaborator

I suspect something like this: crazycodeboy/react-native-splash-screen#289 (comment)

You skipped the template though, so not all the information we'd need is present

@Murugeshrockey-RN
Copy link
Author

Bu I got data payload when the app is background. my problem is i can't get payload data when I tap the notification during foreground and it happens in both android and ios.

@mikehardy
Copy link
Collaborator

If only you'd followed the template, we could maybe see what was going on...

(note: you can always open a new issue, carefully following the template...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants