Comments (12)
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\"}"
from firebase-esp8266.
exactly, the problem is about the Android system.
Unfortunately, the result is a mistake:
in code
firebaseData1.fcm.setDataMessage("{\"sound\":\"default\"}");
compilation error in ARDUINO:
unable to find string literal operator 'operator'"sound"
Generation from firebase.google.com triggers the default sound on your phone so I guess it's all ok
from firebase-esp8266.
See above comment again I forgot the escape char \ for quotes "
Like your first post, replace ON with default.
from firebase-esp8266.
it happens, there is still no sound.
if this call is correct
firebaseData1.fcm.setNotifyMessage or firebaseData1.fcm.setDataMessage ??
....
firebaseData1.fcm.setNotifyMessage("Notification", "Hello World! " + String(count));
firebaseData1.fcm.setDataMessage("{\"myData\":" + String(count) + "}");
firebaseData1.fcm.setDataMessage("{\"sound\":\"default\"}");
....
from firebase-esp8266.
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);
from firebase-esp8266.
thank you, but it did not help.
Arduino 1 .8.7
Error compiling for board LOLIN (WEMOS) D1 R2 & mini.
PlatformIO - compilation after changes library, it's ok but still no sound
from firebase-esp8266.
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.
from firebase-esp8266.
I changed to :
strcat_P(msg, PSTR(",\"sound\":\"default\""));
instead of F, I used PSTR.
it looks like I have a problem with __FlashStringHelper.
with PSTR it works and it's OK thank you!
from firebase-esp8266.
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.
Hi,
Sir I'm trying to send notification message to my flutter app using topic. The message is working fine with google developer console with topic "all" but arduino says message passed but i don't get any notification on phone all. Can you kindly give any idea. If possible plz share code that works.
Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
Firebase.reconnectWiFi(true);
//Set the size of WiFi rx/tx buffers in the case where we want to work with large data.
firebaseData1.setBSSLBufferSize(1024, 1024);
//Set the size of HTTP response buffers in the case where we want to work with large data.
firebaseData1.setResponseSize(1024);
firebaseData1.fcm.begin(FIREBASE_FCM_SERVER_KEY);
firebaseData1.fcm.setPriority("high");
firebaseData1.fcm.setTimeToLive(1000);
firebaseData1.fcm.setTopic("all");
sendMessage();
}
void loop()
{
if (millis() - lastTime > 60 * 1000)
{
lastTime = millis();
sendMessage();
}
}
void sendMessage()
{
Serial.println("------------------------------------");
Serial.println("Send Firebase Cloud Messaging...");
firebaseData1.fcm.setNotifyMessage("Notification", "Hello World!");
//firebaseData1.fcm.setDataMessage("{\"myData\":" + String(count) + "}");
//firebaseData1.fcm.setTopic("all");
//if (Firebase.broadcastMessage(firebaseData1))
//Firebase.sendTopic(firebaseData1);
if (Firebase.sendTopic(firebaseData1))
//if (Firebase.sendMessage(firebaseData1, 0))//send message to recipient index 0
{
Serial.println("PASSED");
Serial.println(firebaseData1.fcm.getSendResult());
Serial.println("------------------------------------");
Serial.println();
}
else
{
Serial.println("FAILED");
Serial.println("REASON: " + firebaseData1.errorReason());
Serial.println("------------------------------------");
Serial.println();
}
count++;
}
from firebase-esp8266.
@ahmedejaz22 Is this work for you? #157
from firebase-esp8266.
from firebase-esp8266.
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
WiFi UART bridge was not supported
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.
from firebase-esp8266.
Related Issues (20)
- ESP8266 is crashing while writing to firebase realtime database HOT 5
- soft wdt reset issue in esp8266 HOT 1
- I'm trying to read this data HOT 2
- WiFiClientSecure issue HOT 6
- Get Token status HOT 1
- issuse HOT 14
- BUG Token info: type = id token (GITKit token), status = on request HOT 1
- PLEASE HELP HOT 3
- [HELP] Cannot connect esp8266 and firebase. Compilation error: invalid conversion from 'int' to 'FirebaseConfig*' {aka 'firebase_cfg_t*'} [-fpermissive] HOT 1
- I've been getting a connection refused after a few seconds
- I've been getting a connection refused after a few seconds after connection to firebase HOT 1
- HELP : Executed HTTPS and connection Firebase HOT 2
- HELP :: captivePortal and firebase connection HOT 4
- BUG FirebaseESP8266.h with version @^4.4.12 of Library HOT 4
- FirebaseJson is confilcted with json inside ESP8266WebServer library HOT 6
- HELP
- Content Available for FCM_HTTPv1_JSON_Message HOT 1
- Unable to Fetch Data from Firebase
- Wi-Fi Reset Doesn't Initialize Firebase Variables and LED Status Doesn't Update Post-Reconnection HOT 6
- ERROR CODE: -3, REASON: NOT CONNECTED STREAM TIMED OUT, RESUMING... HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firebase-esp8266.