What should be the correct path of the notification icon?

Viewed 707

I am using this plugin https://github.com/chemerisuk/cordova-plugin-firebase-messaging for getting notifications. It says that a custom image can be used as a notification if we put this code in the config.xml. I am confused as what should be my icon path here.

<config-file parent="/manifest/application" target="app/src/main/AndroidManifest.xml">
<meta-data
    android:name="com.google.firebase.messaging.default_notification_icon"
    android:resource="@drawable/my_custom_icon_id"/>
</config-file>
1 Answers

If you are tryig to add icon for android in config.xml. we have ionic application and in that we have resource folder. We have given the path of it.

<config-file parent="/manifest/application/" target="app/src/main/AndroidManifest.xml">
            <meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/notification_icon" />
            <meta-data android:name="com.google.firebase.messaging.default_notification_color" android:resource="@color/icon_css" />
        </config-file>
        <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
            <application android:usesCleartextTraffic="true" />
        </edit-config>
        <resource-file src="resources/android/color/color.xml" target="app/src/main/res/values/color.xml" />
        <resource-file src="resources/android/notification_icon/drawable-mdpi/notification_icon.png" target="app/src/main/res/drawable-mdpi/notification_icon.png" />
        <resource-file src="resources/android/notification_icon/drawable-hdpi/notification_icon.png" target="app/src/main/res/drawable-hdpi/notification_icon.png" />
        <resource-file src="resources/android/notification_icon/drawable-xhdpi/notification_icon.png" target="app/src/main/res/drawable-xhdpi/notification_icon.png" />
        <resource-file src="resources/android/notification_icon/drawable-xxhdpi/notification_icon.png" target="app/src/main/res/drawable-xxhdpi/notification_icon.png" />
        <resource-file src="resources/android/notification_icon/drawable-xxxhdpi/notification_icon.png" target="app/src/main/res/drawable-xxxhdpi/notification_icon.png" />
Related