Red
Red

Reputation: 149

not receiving firebase notification from console

i am not receiving notification after sending it through firebase console , i tried sending many notification but received one or two from around 20 notifications, i followed this guide firebase messaging from github ,why am i not receiving notification, my app is installed in one emulator and in one of my phone but when i receive notification which i have sent through notification panel i get them either on phone or emulator never got them on both.

below is the screenshot of my console enter image description here

Upvotes: 11

Views: 25140

Answers (7)

Arkady
Arkady

Reputation: 3232

In my case, what helped me is creating a new simulator in Android Studio

Few things to check:

  • in Firebase console https://console.firebase.google.com/ add/configure the project

  • in Android Studio connect to Firebase - Manu -> Tolls -> Firebase -> Cloud Messaging (Connect, Add FCM to your app)

  • Send notification from Firebase console

So, again, I recreated Virtual Device (open AVD manger and create the same device with the same API level)

I will be happy if somebody will save the time using this post :)

Upvotes: 0

Pavul Zavala
Pavul Zavala

Reputation: 425

  1. check your android app configuration in firebase console

  2. use a restful client to make the request, i suggest chrome-extension://aejoelaoggembcahagimdiliamlcdmfm/dhc.html, there you can see the response of the request, if your request are sent sucessfully or if you have error, and the response tells what kind of error you have

  3. check android app , in the method onMessageReceived and print everything to see if you receive information, besides you can print the property "from" who is the id_number of your proyect, and you can see if the messages come from your firebase android app

  4. check firebase documentation. I've implemented everything just with the guides and its working pretty well

Upvotes: 8

Niamatullah Bakhshi
Niamatullah Bakhshi

Reputation: 1579

I solved the same problem.

The problem seems to be the browser compatibility/version. Mozilla Firefox could easily handle this.

  1. Make sure your app is running in the background.

  2. Open the Firebase notification console in the FireFox browser and send notifications.

Upvotes: 5

Manasvi
Manasvi

Reputation: 530

Make sure token is generated

FirebaseInstanceId.getInstance().getToken();

Upvotes: 1

Saeid
Saeid

Reputation: 2321

Besides the tips that Pavul Zavala said ، keep this in mind that just data message can received by FirebaseMessagingService even application closed or run in background and notification message can't handle(till this moment) when application run in background.

And all message that sent via FireBase console Contains , they always include a notification key

more detail at : Push notification works incorrectly when app is on background or not running

Upvotes: 0

Jan Hartwig
Jan Hartwig

Reputation: 139

in my case, the package name defined at firebase console isn't the same as defined on gradle and manifest of the app (i changed it one time in the app), so the app won't be able to receive notifications sent from firebase console. They both have to be the same!

I did not add a new firebase project, just go to project settings at console and add new android app with another package name and have a look at the newly generated google-services.json and change some lines at you android studio project.

Upvotes: 0

Anandroid
Anandroid

Reputation: 403

Ideally it shouldn't behave like that but it might be due to following reasons:

  • Check the notification priority of your app in the app settings of the device.
  • You might be sending the token of one particular device, Your target should be User segment.

Upvotes: -2

Related Questions