FCM notification not grouping or replacing the existing notification. #233
Unanswered
DipanshuSharma1108
asked this question in
Q&A
Replies: 2 comments 2 replies
-
You can use addCustomNotifyMessage e.g |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you very much for your kind response. Your above stated solution only
solved half of the problem.
Using addCustomNotifyMessage() function I am able to stop displaying individual
notifications for every value. Now the existing notification is getting
replaced by the new one.
But I want the notification to get displayed and make sound only once until
the user cancels the notification. Is it possible anyhow? Please let me
know.
Thanks & Regards
…On Thu, Jul 22, 2021, 4:51 PM mobizt ***@***.***> wrote:
You can use addCustomNotifyMessage
<https://github.com/mobizt/Firebase-ESP8266/tree/master/src#add-the-custom-keyvalue-in-the-notify-message-type-information>
e.g fbdo.fcm.addCustomNotifyMessage("tag","yourTag");.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#233 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AP7K3X3PYUOV4RX5PURL6L3TY75KBANCNFSM5AZYISKQ>
.
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Whenever I am sending my sensor value in a notification from my ESP-8266 to my android app using .setNotify() function, the existing notification is not getting replaced but new notification is generated in the notification tray. I read that we can replace existing notification using notification tag but I don't know where to write the tag in my Arduino code. Can anyone please help me?
`#if defined(ESP32)
#include <WiFi.h>
#include <FirebaseESP32.h>
#elif defined(ESP8266)
#include <ESP8266WiFi.h>
#include <FirebaseESP8266.h>
#endif
const int analogInPin =A0;
int moistureValue = 0;
//Provide the token generation process info.
#include "addons/TokenHelper.h"
//Provide the RTDB payload printing info and other helper functions.
#include "addons/RTDBHelper.h"
/* 1. Define the WiFi credentials */
#define WIFI_SSID ""
#define WIFI_PASSWORD ""
#define API_KEY "API_KEY"
#define DATABASE_URL "tokenapp-ba3e5-default-rtdb.firebaseio.com"
#define FIREBASE_FCM_SERVER_KEY ""
#define FIREBASE_FCM_DEVICE_TOKEN_1 " "
//#define FIREBASE_FCM_DEVICE_TOKEN_2 "ANOTHER_RECIPIENT_DEVICE_TOKEN"
#define USER_EMAIL "USER_EMAIL"
#define USER_PASSWORD "USER_PASSWORD"
FirebaseData fbdo;
//int counterHigh =0, counterLow =0;
void sendLowMessage();
void sendHighMessage();
FirebaseAuth auth;
FirebaseConfig config;
unsigned long sendDataPrevMillis = 0;
void setup()
{
// fbdo.fcm.addDeviceToken(FIREBASE_FCM_DEVICE_TOKEN_2);
}
void loop()
{
moistureValue= analogRead(analogInPin);
Serial.println("Moisture Reading = ");
Serial.print(moistureValue);
if (Firebase.ready() && (millis() - sendDataPrevMillis > 5000 || sendDataPrevMillis == 0))
{
sendDataPrevMillis = millis();
}
void sendHighMessage()
{
}
void sendLowMessage()
{
}`
This is my code. Kindly suggest a solution to this. Thanks in Advance.
Beta Was this translation helpful? Give feedback.
All reactions