invertase / react-native-firebase

šŸ”„ A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
https://rnfirebase.io
Other
11.66k stars 2.21k forks source link

šŸ”„ Icon on action notification does not display as expected #2012

Closed Thebarda closed 5 years ago

Thebarda commented 5 years ago

Issue

I'm experiencing an issue about action notification. Indeed, I want to display an icon ('ic_launcher'), that exist in mipmaps, in action button but it display a grey icon on android API 23 and no icon on android API 28. Here is a screen fron android API 23 : Screenshot from 2019-03-28 11-17-53


Project Files

Here is my code that create action :

const action = new firebase.notifications.Android.Action('action', 'ic_launcher', 'My Action')
  // Add action to the notification
  notification.android.addAction(action)

iOS

ios/Podfile:

# N/A

AppDelegate.m:

// N/A

Android

android/build.gradle:

// N/A

android/app/build.gradle:

// N/A

android/settings.gradle:

// N/A

MainApplication.java:

// N/A

AndroidManifest.xml:

<!-- N/A -->

Environment

Kikketer commented 5 years ago

I'm seeing similar problems with the default notification icon following the steps described here: https://rnfirebase.io/docs/v5.x.x/notifications/android

My manifest contains:

<application ...>
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_channel_id"
            android:value="notifications"/>
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_color"
            android:resource="@color/colorAccent" />
        <meta-data
            android:name="com.google.firebase.messaging.default_notification_icon"
            android:resource="@drawable/my_notification_icon" />

Attempting to send a notification via displayNotification requires that I put .android.setChannelId( even though I believe the default should kick in when it's not there.

The icon is not being set either per the defaults. Notifications from Firebase itself are not appearing because currently they do not have a channelId set, which leads me to believe the default channelId is also not working.

Culzean commented 5 years ago

I am also encountered this issue while running on Android API 27 or lower. I have tried setting the default_notification_icon in the manifest and an icon within firebase.notifications.Android.Action. Note that the icon correctly displays on Android 28. Any help would be greatly appreciated.

Culzean commented 5 years ago

Note I'm using this following version of firebase "com.google.firebase:firebase-core:16.0.7" "com.google.firebase:firebase-messaging:17.3.4"

stale[bot] commented 5 years ago

Hello šŸ‘‹, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.

Thebarda commented 5 years ago

Hello , to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs. Thank you for your contributions.

This issue has not been fixed yet

mikehardy commented 5 years ago

This has nothing to do with the library, it's the way icons work in Android in newer APIs

https://stackoverflow.com/questions/40404916/android-notification-icon-is-a-white-circle