arnesson / cordova-plugin-firebase

Cordova plugin for Google Firebase
http://arnesson.github.io/cordova-plugin-firebase
MIT License
1.01k stars 1.55k forks source link

Change android notification icon #634

Closed michelsondan closed 5 years ago

michelsondan commented 6 years ago

The Notification Icon that is showing is of Cordova, not my icon. I use cordova-firebase-plugin 0.1.25 with Quasar.

1. I have put all icons in src-cordova\platforms\android\app\src\main\res\drawable-X (I named the icon's to "notification_icon.png")

image

2. Change in src-cordova\platforms\android\app\src\main\AndroidManifest.xml -

image

3. I even try to change in server side - notification = new { body = myBody, title = myTitle, sound = "Enabled", icon = "notification_icon" }

Not working.

Notice - In version 0.1.24 it worked perfect !

Please help Thanks

michelsondan commented 6 years ago

Someone? at least can someone write from where the default icon location (Cordova icon) so I can try to overwrite it...

jackvial commented 6 years ago

+1 Would be good to get something in the docs on this. Currently looking into how to fix it, will post here if I find a solution.

almasmaris commented 6 years ago

@jackvial hello any update for this?

Zvika88 commented 6 years ago

+1

Zvika88 commented 6 years ago

BTW this used to work with the icons pngs in the drawable folders as descrived above when on my Node.js server I used fcm-node package and put the 'icon' property in my notification object.

However now that I switched to admin.messaging() , (because fcm-node is outdated and no longer supports desktop push), this is no longer working. Help is much needed here, thanks!

marcelledi commented 5 years ago

Any news?

almasmaris commented 5 years ago

@marcelledi add this <meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/notification_icon" /> inside application tag works for me

kpshinde commented 5 years ago

Any update on this issue?

monn1 commented 5 years ago

@kpshinde Try to do what @almasmaris said. It worked for me.

soumak77 commented 5 years ago

closing as resolved per @almasmaris's comment

mrtaltnn commented 5 years ago

My problem is continuing.

My plugin version: 1.0.5 (I use this version for issue #899 problem) Cordova android version: 6.4.0

Config.xml

     <resource-file src="resources/android/icon/drawable-xxxhdpi-icon.png" target="res/drawable/notification_icon.png" />
        <resource-file src="resources/android/notification/drawable-hdpi/notification_icon.png" target="res/drawable-hdpi/notification_icon.png" />
        <resource-file src="resources/android/notification/drawable-ldpi/notification_icon.png" target="res/drawable-ldpi/notification_icon.png" />
        <resource-file src="resources/android/notification/drawable-mdpi/notification_icon.png" target="res/drawable-mdpi/notification_icon.png" />
        <resource-file src="resources/android/notification/drawable-xhdpi/notification_icon.png" target="res/drawable-xhdpi/notification_icon.png" />
        <resource-file src="resources/android/notification/drawable-xxhdpi/notification_icon.png" target="res/drawable-xxhdpi/notification_icon.png" />
        <resource-file src="resources/android/notification/drawable-xxxhdpi/notification_icon.png" target="res/drawable-xxxhdpi/notification_icon.png" />
        <resource-file src="resources/android/notification/mipmap-hdpi/notification_icon.png" target="res/mipmap-hdpi/notification_icon.png" />
        <resource-file src="resources/android/notification/mipmap-ldpi/notification_icon.png" target="res/mipmap-ldpi/notification_icon.png" />
        <resource-file src="resources/android/notification/mipmap-mdpi/notification_icon.png" target="res/mipmap-mdpi/notification_icon.png" />
        <resource-file src="resources/android/notification/mipmap-xhdpi/notification_icon.png" target="res/mipmap-xhdpi/notification_icon.png" />
        <resource-file src="resources/android/notification/mipmap-xxhdpi/notification_icon.png" target="res/mipmap-xxhdpi/notification_icon.png" />
        <resource-file src="resources/android/notification/mipmap-xxxhdpi/notification_icon.png" target="res/mipmap-xxxhdpi/notification_icon.png" />
        <resource-file src="resources/android/notification/drawable-hdpi/notification_icon.png" target="app/src/main/res/drawable-hdpi/notification_icon.png" />
        <resource-file src="resources/android/notification/drawable-ldpi/notification_icon.png" target="app/src/main/res/drawable-ldpi/notification_icon.png" />
        <resource-file src="resources/android/notification/drawable-mdpi/notification_icon.png" target="app/src/main/res/drawable-mdpi/notification_icon.png" />
        <resource-file src="resources/android/notification/drawable-xhdpi/notification_icon.png" target="app/src/main/res/drawable-xhdpi/notification_icon.png" />
        <resource-file src="resources/android/notification/drawable-xxhdpi/notification_icon.png" target="app/src/main/res/drawable-xxhdpi/notification_icon.png" />
        <resource-file src="resources/android/notification/drawable-xxxhdpi/notification_icon.png" target="app/src/main/res/drawable-xxxhdpi/notification_icon.png" />
        <config-file parent="./application" target="AndroidManifest.xml">
            <meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/notification_icon" />
        </config-file>

Folder image

Payload {"tap":true,"body":"testPanel","date":"1538738092","icon":"notification_icon","pnid":"2441","alert":"testPanel","notId":"29134","title":"TEST","deeplink":"{\"parameters\":{\"contentType\":\"announcement\",\"referenceId\":95},\"pageName\":\"content-detail\"}"}]

Statusbar image

Problem image

Farrukhbek11 commented 2 years ago

Try to build apk, in apk working with original icon. I think problem in in emulator