Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 29449

How to set android push notification color and icon?

$
0
0

I am using react-native, amplify, and pinpoint.

I have followed several guides and stack overflow questions to set the android default color and icon for push notifications like this:

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

I have a file colors.xml inside of android/app/src/main/res/values/ with this content:

<resources><color name="patch_coral">#E97A6E</color></resources>

And for the icon I have drawable folders inside of android/app/src/main/res/ which contain the ic_notification.png generated in android asset studio as white icons as was instructed in several places.

I have also tested with debug and release builds to see if that would change anything; however, the push notifications still do not have the default icon or color, but it does have the app icon on the right side. Here is an example:

current android push notification example

What needs to be changed or added to get the color and icon to replace the default android color, and square icon?


Viewing all articles
Browse latest Browse all 29449

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>