I want to replace the default Icon with my own icon for Push-notifications.
Now the App show the Icon as White box .
Navigate to Messages > New Push > Platform Settings > Google Android Options > Set the icon name without the file extension. With Large Notification Icons, you can also supply a URL where the icon will be displayed from.
To customize it, first pull down the slider bar from the top of the screen. Next, tap on the three vertical dots in the top right corner. Now click on Status bar. You're in.
Push notifications are automated notifications that the app sends mobile users if the push notification feature is enabled. When a push notification is sent, Android devices show a small push icon in the status bar and notification drawer.
Ajay's answer is correct, but to expand on it a bit:
Create your mipmap notification icon. You can do this easily using Roman's Notification Icon Generator - Click on "Notification Icon Generator"
On the left panel, click "Image" to upload your own image or use ClipArt or text as provided.
After you're done, click the download button in the upper-right to download the zip file.
In the zip file, your icon files will be in individual directories with the same name as your mipmap directories in your project directory (e.g., "mipmap-hdpi", "mipmap-mdpi", etc.). Move the icon files to their respective folders within your project.
In your AndroidManifest.xml file (located at android/app/src/main/AndroidManifest.xml
), add the meta-data within the "application" tag:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.your.package">
<application
android:name="com.your.package.Application"
android:label="YourAppName"
android:icon="@mipmap/launcher_icon">
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@mipmap/your_icon_file_name" />
Save your file. You may need to stop and restart or uninstall and reinstall your app for the notification icon to start showing.
Your icon is probably white, so if you want to change the color you can add the following meta-data tag below the icon meta-data tag you just added:
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@android:color/black" />
That will change the icon to black, but you can set your own colors in res/values
as stated here: Android System Color Constants
Information about the meta-data tags is here: https://firebase.google.com/docs/cloud-messaging/android/receive
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With