-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
Cloud Messaging no sound #33
Comments
For Android From this ref. The sound to play when the device receives the notification. Supports "default" or the filename of a sound resource bundled in the app. Sound files must reside in /res/raw/ Try this if you don't know or not prepared sound file. "{\"sound\":\"default\"}" |
exactly, the problem is about the Android system. Generation from firebase.google.com triggers the default sound on your phone so I guess it's all ok |
See above comment again I forgot the escape char \ for quotes " Like your first post, replace ON with default. |
it happens, there is still no sound. firebaseData1.fcm.setNotifyMessage or firebaseData1.fcm.setDataMessage ??
.... |
Actually I'm not prepare all parameters for notification message, you should edit library at line 5475 of FirebaseESP8266.cpp From strcat_P(msg, ESP8266_FIREBASE_STR_127);
to strcat_P(msg, F(",\"sound\":\"default\""));
strcat_P(msg, ESP8266_FIREBASE_STR_127); |
thank you, but it did not help. PlatformIO - compilation after changes library, it's ok but still no sound |
The modification is not cause the error on Arduino IDE except for your message is too large (400 bytes are reserved for build the message payload) or you make something wrong. Sound depends on your mobile device settings whether you muted the notification or not, check your phone settings. I can hear the notification sound with this modified payload. |
I changed to : with PSTR it works and it's OK thank you! |
Hi,
} void loop() void sendMessage() Serial.println("------------------------------------"); firebaseData1.fcm.setNotifyMessage("Notification", "Hello World!");
//firebaseData1.fcm.setTopic("all"); //if (Firebase.broadcastMessage(firebaseData1))
} count++; |
@ahmedejaz22 Is this work for you? #157 |
sadly beyond 2.9.5 library doesn't work on nodemcu - gives error compiling
errors
thanks for remembering
Best Regards,
Ahmed
…On Fri, Dec 11, 2020 at 6:33 PM mobizt ***@***.***> wrote:
@ahmedejaz22 <https://github.com/ahmedejaz22> Is this work for you? #157
<#157>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#33 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFK5HN5HKTGD5QQXLSYFD2LSUINTVANCNFSM4H2ZJIIQ>
.
|
You may need to update the ESP8266 Arduino Core SDK to latest. If you include some WiFi UART bridge library in the sketch and see the compiler error like this You can't use the Firebase library in your sketch with that library included. If the errors are about multiple libraries found, you 're installing the ambiguous libraries with the same class name or file name in many locations which used by this Firebase library but these libraries come from different repos and are not compatible to each other e.g. SD.h installed in libraries folder which you may install and SD.h in the core library which used by Firebase library will cause the compilation errors. |
Hi,
I am using Firebase-ESP8266 Library, example of Cloud_Messaging. My question is how to start the sound in push notification. I tried eg
firebaseData1.fcm.setDataMessage ("{\" sound \ ": \" ON \ "}");
I am asking for a suggestion. thanks.
The text was updated successfully, but these errors were encountered: