question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug(cloud-messaging): not getting body payload when app is background

See original GitHub issue

Plugin(s):

@capacitor-firebase/authentication”: “^0.3.1”, “@capacitor-firebase/messaging”: “^0.3.1”, “firebase”: “^9.8.3”,

Platform(s):

Android

Current behavior:

I see background notification messaging service. It is already implemented. I am not getting the body payload when app is in background but I do get the notification. image

Expected behavior:

It should have other body payload too image

Steps to reproduce:

Related code:

insert short code snippets here

Other information:

Capacitor doctor:

   Capacitor Doctor

Latest Dependencies:       

  @capacitor/cli: 3.6.0    
  @capacitor/core: 3.6.0   
  @capacitor/android: 3.6.0
  @capacitor/ios: 3.6.0    

Installed Dependencies:    

  @capacitor/ios: not installed
  @capacitor/cli: 3.5.0    
  @capacitor/core: 3.5.0   
  @capacitor/android: 3.5.1

[success] Android looking great! 👌```

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
indraraj26commented, Jul 7, 2022

Thanks a lot for your suggestion 😃, and It is working

1reaction
radru1commented, Jul 7, 2022

If I understand docs correctly overriding onMessageRecieved won’t help you if you are sending a notification to background app as it’s simply not called. see: https://firebase.google.com/support/faq/#fcm-android-background or table I linked before. If all you need to do is have body information place it in data object of cloud message payload too, not only in notification.body

Read more comments on GitHub >

github_iconTop Results From Across the Web

bug(cloud-messaging): not getting body payload when app is ...
Current behavior: I see background notification messaging service. It is already implemented. I am not getting the body payload when app is in ......
Read more >
Firebase onMessageReceived not called when app in ...
As per Firebase Cloud Messaging documentation-If Activity is in foreground then onMessageReceived will get called. If Activity is in background or closed ...
Read more >
Receive messages in an Android app - Firebase - Google
Notification messages delivered when your app is in the background. ... Messages with both notification and data payload, when received in the background....
Read more >
Firebase Cloud Messaging for Android: Sending Push ...
A method to connect your mobile app with the Firebase console. The difference between receiving messages in the foreground and background of ...
Read more >
Push Notifications with Firebase in React.js
This includes when the application is active or inactive or not open in the browser and when the browser is inactive. Firebase Cloud...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found