zetavg / react-native-system-notification

Android system notifications for React Native. Supports push notifications with GCM integrated.
https://www.npmjs.com/package/react-native-system-notification
244 stars 102 forks source link

smallIcon not showing #12

Open nabati opened 8 years ago

nabati commented 8 years ago

Hi,

I'm having issues with displaying any other smallIcon. Code below:

    Notification.create({
        subject: "Subjecasdast",
        message: "sss",
        smallIcon: 'ic_launcher',
    });

I always get the same icon.

image

Folder structure looks like this (ic_launcher.png-files are in each folder!)

image

Any ideas why this isn't working? The icon is showing in the app drawer.

Using 0.1.6.

nabati commented 8 years ago

Renaming the icon to something else does not work either.

nabati commented 8 years ago

Additional info:

Above image was from an emulator running Android 6.0.

Running the application on Android 5.0 displays the icon but with the wrong size (a small variant of the icon is surrounded by a large gray area).

zetavg commented 8 years ago

According to my knowledge of Android, if you are using smallIcon on >5.0, the system will convert your icon to a white outline when it's shown on the notification (i.e.: using only the alpha channel of the PNG). Because you're using an square icon, so things may seem broken as only a white square is show. Maybe you can try using another image with irregular contours and see if it takes effect.

In my opinion, these are actually not problems, but limitations of the Android system.

pickhardt commented 8 years ago

I'm getting the same white square with a gray circle on an actual device, running Android 5.1 and RN 0.20, this version 0.1.8.

The ic_launcher.png is in the right place.

@poyannabati what did you do to fix it?

jlugner commented 8 years ago

Have you tried making the background of the image transparent? That did the trick for me.