0

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!

Catalin Iancu
  • 722
  • 5
  • 18
  • https://stackoverflow.com/questions/30795431/android-push-notifications-icon-not-displaying-in-notification-white-square-sh – Kishan Mevada May 02 '22 at 09:48
  • Yes, I saw that post but it doesn't seem to apply in my case. There it's a 6 year old problem while in my case seems to work on anything except the newest android. – Catalin Iancu May 02 '22 at 09:55
  • Any help did you got? Even I didn't get any icon picture in android 12 –  Sep 23 '22 at 09:03

1 Answers1

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.

  • This was my issue. I had the meta-data tag under the `application` and within the `provider` tag. It needs to be at the root `application` – Dadles Nov 21 '22 at 14:48