Skip to content
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

No device token provided on Firebase.sendTopic #25

Closed
arushgupta2007 opened this issue May 19, 2019 · 10 comments
Closed

No device token provided on Firebase.sendTopic #25

arushgupta2007 opened this issue May 19, 2019 · 10 comments

Comments

@arushgupta2007
Copy link

arushgupta2007 commented May 19, 2019

Hi,

I am trying to use cloud messaging in esp8266 to give notification to android phone
My android phone has subscribed to the topic "general"

As a test I am sending the message in the void setup method

My esp8266 code :

`

Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);

Firebase.reconnectWiFi(true);

firebaseData.fcm.begin("SECRET_KEY_IS_COPIED");

firebaseData.fcm.setPriority("high");

firebaseData.fcm.setTimeToLive(60);

firebaseData.fcm.setNotifyMessage("Notification", "Hello World!", "firebase-logo.png",
"http://www.google.com");
firebaseData.fcm.setTopic("general");

if (Firebase.sendTopic(firebaseData))
{
//Success, print the result returned from server
Serial.println(firebaseData.fcm.getSendResult());
}
else
{
//Failed, print the error reason
Serial.println(firebaseData.errorReason());
}

`

And Error log:

`
No device token provided

`

Why do I need to give device token for topics?

@mobizt
Copy link
Owner

mobizt commented May 19, 2019

This is a bug and I jus fix this issue and update to v 2.1.2.
Thank for your report.

@arushgupta2007
Copy link
Author

Thanks

@arushgupta2007
Copy link
Author

Is it updated? Can I re-download the library?

@mobizt
Copy link
Owner

mobizt commented May 19, 2019

Yes, you need to delete the old one and download new zip file from this GitHub. Arduino library manager was not the latest version.

@arushgupta2007
Copy link
Author

Ok

@arushgupta2007
Copy link
Author

It worked!
Thanks man, your library has saved my life 👍 :)

@afung2468
Copy link

Hi Mobizt. I am using Firebase ESP8266 Client Version 2.8.5. but I am still getting this "No device token provided" message. Which version should I use to get rid of this error? Thanks.

@mobizt
Copy link
Owner

mobizt commented Apr 13, 2020

@afung2468
The issue was fixed since v 2.1.2.

See the fcm example

@afung2468
Copy link

afung2468 commented Apr 13, 2020 via email

@mobizt
Copy link
Owner

mobizt commented Apr 14, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants