Android Question No Firebasenotifications when app is closed

DactilPlus

Member
Licensed User
Hello, I just implemented firebase notifications on iOs and Android, and they go well with the app turned on in the background.

In iOS it shows the notification when the app is off, but not Android.

Update the Android device, but I can not get the notification with the app off.


I followed the tutorial step by step, but I do not see what is wrong.

Any idea where the problem might be?
 

KMatle

Expert
Licensed User
Any idea where the problem might be?
1. Probably enegery savings. On some phones your app will not run when in background/screen is off. Only "known" apps like WhatsApp are in a whitelist. Check that. If it is so, there's no chance to automatically add it to the whitelist. You can then inform the user to do so. I had this on an Huawei P8 making me crazy 'till I found out. You can test it on a phone where it is working. Just change the settings to "no run when in background".

2. Wrong FCM message type? If you send just data messages, you have to care to throw a notification by code. On mixed or notification message type Android will do it for your app (see Google docs about it)
 

DactilPlus

Member
Licensed User
Thank you for the prompt response, It just happens to me in a Huawei P8, how did you solve it?

by the way, with the screen on but the app off does not show the notifications either.
 
Last edited:

marcick

Well-Known Member
Licensed User
I think you have some mistakes somewhere in your code. Firebase notifications should be very reliable in every condition. I suggest you to start a blank project and follow the tutorial.
 
Top