Not Receiving Push Notifications When App Is Closed


#1

I’ve got my standalone Android app receiving notifications when my app is in the background, but it doesn’t seem to be receiving them when the app is closed. Is there something I need to do to enable this? Some permissions? I already added:
“android”: {
“permissions”: [“com.google.android.c2dm.permission.RECEIVE”]
}

Any advice that anyone has?


#2

I think maybe you need to actually perform an action on the notification to open your app, and then the notification will be delivered to your app. Have you tried that?


#3

I don’t actually receive the notification at all as far as I can tell if
the app is closed. So I can’t click on it to open the app.

Eric


#4

According to the docs:

Expo apps don’t support background code execution (running code when the app is not foregrounded or the device is sleeping). This means you cannot use background geolocation, play audio in the background, handle push notifications in the background, and more. This is a work in progress.
https://docs.expo.io/versions/latest/introduction/why-not-expo.html

I also look forward to a solution to this. Hopefully someone with more insight can weigh in.


#5

Hello Eric
did you resolve this problem?
I have got problem same as you.


#6

Earlier in the thread user shmck referenced a section of the docs that said that push notifications aren’t working in the background yet.


#7

I have the same problem. Notifications are not received on android when application is closed. Unfortunately, the most part of time the app is not opened so expo notifications are just useless…


#8

This is a setting in Android; Battery Optimization, turn it off for your application (I think by default it is turned on, saying ‘Limit background activity of apps to lengthen battery life’. After turning it off your device WILL receive notifications, even when the application itself is closed.


#9

@softhib I have a Lenovo A6020 that does not receive notifications when app is closed, but the rest of devices that I have tested on have no problems (Huawei P9 lite, Samsung S9, for naming a few).


#10

On Android there is a lot of parameters that can conduct to not receive notifications especially Battery Optimisation enabled.