Oreo (8.0) status bar notification icon all white

2019-08-02 03:52发布

问题:

I'm currently having problems with Android Oreo showing the notification icon correctly in the status bar and on the notification itself (screenshots provided below).

To create the icons, I am using Android 3.1, right clicking on the res folder and choosing New > Image Asset. Within that, I'm uploading an all white png (as per docs) and selecting a red background as per screenshot:

Within the AndroidManifest.xml, I set the icon like this:

<application ... android:icon="@mipmap/ic_launcher"

The actual App looks correct, but the notification icon does not show up correctly.

Notification icon errors:

回答1:

You need to create icon as per this

Also you need to add

<meta-data
    android:name="com.google.firebase.messaging.default_notification_icon"
    android:resource="@drawable/statusbar_notification" />

in AndroidManifest