'Android 12 - Push notification icon problem (Firebase messaging)
I have an app for android built with Reactjs + Capacitor. The implementation follows the installation guide on the Firebase documentation and I am not using a custom notification layout. By using the following code in the manifest I am able to receive notifications with icons properly on any device that doesn't use Android 12
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_launcher_foreground" />
But on Android 12 the icon is not visible. I tried several different ways to include the icon, with either a direct png or xml resource.
What exactly am I missing for Android 12 devices specifically? Thanks!
Solution 1:[1]
Make sure your Meta-data is under the application tag and not the activity tag. At least this was the issue in my case, notification icon seemed to work fine except on Android 12. Putting the meta-data under application tag fixed it for me.
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 | edgar tremillo |
