Catalin Iancu
Catalin Iancu

Reputation: 722

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!

Upvotes: 0

Views: 2682

Answers (1)

edgar tremillo
edgar tremillo

Reputation: 21

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.

Upvotes: 1

Related Questions