firebase-cpp-sdk icon indicating copy to clipboard operation
firebase-cpp-sdk copied to clipboard

[Bug] Duplicating data message

Open mea405 opened this issue 4 years ago • 5 comments

[REQUIRED] Please fill in the following fields:

  • Pre-built SDK from the website or open-source from this repo: both_
  • Firebase C++ SDK version: 8.6.0___
  • Problematic Firebase Component: messaging___ (Auth, Database, etc.)
  • Other Firebase Components in use: _____ (Auth, Database, etc.)
  • Platform you are using the C++ SDK on: Mac_ (Mac, Windows, or Linux)
  • Platform you are targeting: ios_ (iOS, Android, and/or desktop)

[REQUIRED] Please describe the issue here:

When sending a message like, a second notification comes { "data": { "str1": "str1", "str2": "str2" }, "content_available": true }

Steps to reproduce:

Send message with: "content_available": true

Have you been able to reproduce this issue with just the Firebase C++ quickstarts ? Yes

What's the issue repro rate? (eg 100%, 1/5 etc) 100%

What happened? How can we make the problem occur? This could be a description, log/console output, etc.

If you have a downloadable sample project that reproduces the bug you're reporting, you will likely receive a faster response on your issue.

Relevant Code:

curl --location --request POST 'https://fcm.googleapis.com/fcm/send'
--header 'Authorization: key=....'
--header 'Content-Type: application/json'
--data-raw '{ "to" : "...", "content_available": true, "data" : { "key1" : "value1", "key2": "value2", "key3": "value3" } }'

mea405 avatar Nov 01 '21 16:11 mea405

8.7.0 - same problem

mea405 avatar Nov 08 '21 07:11 mea405

Hi @mea405

Are you using Firebase C++ SDK or Firebase Messaging REST API? I am asking because in the Relevant code section, you mentioned a Curl command line.

Also, could you elaborate on what you meant by this?

When sending a message like, a second notification comes { "data": { "str1": "str1", "str2": "str2" }, "content_available": true }

Thank you

chkuang-g avatar Nov 11 '21 02:11 chkuang-g

Hi,

Our iOS project uses Firebase C++ SDK in to receive messages. When we send a test message using curl script we get two notifications. This happens with QuickStart cpp example: https://github.com/firebase/quickstart-cpp/tree/master/messaging/testapp

Moreover, if a regular notification is sent, then the receiving handler is triggered only once. As far as I can tell, repeated invocation of the receive handler causes "content_available": true without which data messages (“silent” messages) are not delivered.

Thank you

On 11 Nov 2021, at 05:56, chkuang-g @.***> wrote:

Hi @mea405 https://github.com/mea405 Are you using Firebase C++ SDK or Firebase Messaging REST API? I am asking because in the Relevant code section, you mentioned a Curl command line.

Also, could you elaborate on what you meant by this?

When sending a message like, a second notification comes { "data": { "str1": "str1", "str2": "str2" }, "content_available": true }

Thank you

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/firebase/firebase-cpp-sdk/issues/716#issuecomment-965944365, or unsubscribe https://github.com/notifications/unsubscribe-auth/AELGYAI3HEB5HDIB3A2PEODULMWENANCNFSM5HELO3OQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.


Maxim @.***

mea405 avatar Nov 11 '21 08:11 mea405

I was able to successfully reproduce the problem on iOS using curl and the quick start. Thanks for creating this issue and providing the necessary information to reproduce it! I'll mark this as a bug so that we can track it internally.

DellaBitta avatar Nov 16 '21 16:11 DellaBitta

Unfortunately, this seems to still be an issue 2 years later. I am seeing this on 11.6.0, but I'm actually getting three messages per message now.

@DellaBitta Sorry to @ you but could you update the issue internally, or confirm if it still exists?

Thanks

camgaertner avatar Dec 06 '23 22:12 camgaertner