'Android 12 firebase push notifications don't work when app is in the background
I'm sending test push notifications form firebase>compose notification page. I receive push notifications on Android 8, 9, 10, 11, but not 12.
And I have two devices on Android 12: physical phone Samsung S22 and Pixel emulator. In both cases Push Notifications don't appear in the Notification tray.
Note:
- I'm speaking about notification which system shows in the Notification tray while app is being in the background. When app is in the foreground, then onMessageReceived works as expected on Android 12.
- token is correct
- in all cases I close the app in order to get Push in Notification tray
- if I use
android:exported="false"
- still doesn't work
My service in the android manifest:
<service
android:name=".old.push.FCMHandlerService"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
Solution 1:[1]
enter link description hereWhen I updated firebase dependencies to the latest version it started working.
Thanks WhiteSpidy for your comment.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Andrew |