10

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

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Red
  • 139
  • 1
  • 2
  • 9
  • 2
    (cool name) how are you checking for the notifications, note that when the app is in the foreground no notification will be generated. – Arthur Thompson Jul 19 '16 at 20:52
  • Your screen looks like mine. It seem it wont be working right as one would expect. I was like you too frustrated. then when to gym and I saw it working when I got back. so I would say let it settle down (provided you followed docs as it is) – Alok C Aug 04 '16 at 18:22

7 Answers7

8
  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

Soorena
  • 4,352
  • 5
  • 30
  • 42
Pavul Zavala
  • 427
  • 5
  • 11
5

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.

Pang
  • 9,564
  • 146
  • 81
  • 122
Niamatullah Bakhshi
  • 1,445
  • 16
  • 27
1

Make sure token is generated

FirebaseInstanceId.getInstance().getToken();
Yahya Hussein
  • 8,767
  • 15
  • 58
  • 114
Manasvi
  • 450
  • 7
  • 9
0

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.

Jan Hartwig
  • 139
  • 4
0

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

Community
  • 1
  • 1
Saeid
  • 2,261
  • 4
  • 27
  • 59
0

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 :)

Arkady
  • 3,196
  • 24
  • 19
-2

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.
Anandroid
  • 403
  • 4
  • 14