1

After upgrading to android sdk to v26 the notification icons became white boxes, we have solved this issue by using white/transparent icons.

However, on Samsung phones the small icons in push notifications are green android robots. In all other phones where push notifications are using large icons (white/transparent) it works perfectly.

How can we fix the Samsung issue?

I am using:

  • React native: 0.56 (0.55.4 too)
  • React native firebase: 3.3.1
  • Android Target SDK: 26

I have:

  • ic_launcher.png which is a multi-color logo for the app.
  • ic_notification.png which is white/transparent logo for the >Lolipop push notifications.

Corresponding lines in android.manifest:

    <application
      android:name=".MainApplication"
      android:allowBackup="true"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:theme="@style/AppTheme">
        <meta-data
          android:name = 
          "com.google.firebase.messaging.default_notification_icon"
          android:resource="@mipmap/ic_notification"
        />
        <meta-data 
          android:name = 
          "com.google.firebase.messaging.default_notification_color"
          android:resource="@color/orange" 
        />
Mikayel Saghyan
  • 728
  • 9
  • 23

2 Answers2

1

We solved this after many hours by:

  1. Making sure the icon is the right color and size using https://developer.android.com/studio/write/image-asset-studio#create-notification
  2. Updating our Firebase SDKs in build.gradle to:

implementation 'com.google.firebase:firebase-messaging:17.3.1'
implementation 'com.google.firebase:firebase-core:16.0.3'

Version 11.0.8 (and possibly others) have a known bug, so using at least 12.0.0 should solve it.

David Hellsing
  • 106,495
  • 44
  • 176
  • 212
0

Try to change the react-native version to 0.55.4. Newer versions may have a problem with icons.

ImpoUserC
  • 599
  • 5
  • 16