-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Not receiving message when app is close on Android #2074
Comments
It is my understanding for Android development that if your app is actually closed/killed, it is not running at all, so it may not receive messages period - it can't do anything. The only way to then have it come alive again is to register for some Intent that the system will send. I am naive with regard to firebase messaging in particular but I would look in the docs for some form of BroadcastReceiver (to catch an Intent) that you are supposed to put in your AndroidManifest, hooked to Google Play services for messaging somehow. If you are able to look in Android Studio at the "merged" AndroidManifest and you see no receivers (either from your project or merged in from a library) then there's no mechanism to start the app in response to an Intent so it isn't able to do anything |
Is there any working code that I can refer. I have searched across the internet tied different codes but nothing seems to work :( |
Looks like it is almost impossible to do it reliably |
Can you provide a link to steps you followed? |
Looks like this is a very weird intended behavior: |
Hello 👋, to help manage issues we automatically close stale issues.
|
This issue is not fixed yet, I need more help from community. It would be glad for me or others, if anyone found solution. |
Looking for a solution as well. |
Hello 👋, to help manage issues we automatically close stale issues.
|
Closing this issue after a prolonged period of inactivity. If this is still present in the latest release, please feel free to create a new issue with up-to-date information. |
I followed the steps mentioned here.
Now, I'm receiving messages when app is in foreground via firebase.messaging().onMessage and in the background via a headless task I defined according to the same guide, but I don't receive messages when the app is closed
I am using one plus 6, where I even disabled the Battery optimise option for my phone, tried installing a signing build but none of it is working.
Even added this on AndroidManifest.xml
<service android:name="io.invertase.firebase.messaging.RNFirebaseBackgroundMessagingService" />
Am I missing anything on native side ?
The text was updated successfully, but these errors were encountered: