I am trying to display app icon in notification. But it is displaying blank icon.
I have given pushoptions as below:
const options: PushOptions = {
android: {
titleKey: 'App',
sound: 'true',
icon: 'res/drawable/notification_icon',
topics: ['MyTopic']
},
ios: {
alert: 'true',
badge: false,
sound: 'true'
},
windows: {}
};
and copied the icon image as below which has resolution of 40*40px.
<resource-file src="resources/notification_icon.png" target="res/drawable/notification_icon.png" />
Is there anything that I am missing?
Update:
I followed this link : https://github.com/ionic-team/ionic-cli/issues/608 and tried it by copying all the notification icon under resources/android/notification/drawable-XYZ/ic_stat_ac_unit.png to res/drawable-XYZ/ic_stat_ac_unit.png using the following statements:
<resource-file src="resources/android/notification/drawable-hdpi/ic_stat_ac_unit.png" target="res/drawable-hdpi/ic_stat_ac_unit.png" />
<resource-file src="resources/android/notification/drawable-mdpi/ic_stat_ac_unit.png" target="res/drawable-mdpi/ic_stat_ac_unit.png" />
<resource-file src="resources/android/notification/drawable-xhdpi/ic_stat_ac_unit.png" target="res/drawable-xhdpi/ic_stat_ac_unit.png" />
<resource-file src="resources/android/notification/drawable-xxhdpi/ic_stat_ac_unit.png" target="res/drawable-xxhdpi/ic_stat_ac_unit.png" />
<resource-file src="resources/android/notification/drawable-xxxhdpi/ic_stat_ac_unit.png" target="res/drawable-xxxhdpi/ic_stat_ac_unit.png" />
and modified PushOptions in app.component.ts to :
android: {
titleKey: 'App',
sound: true,
vibrate:true,
icon: 'ic_stat_ac_unit',
iconColor:'#343434',
topics: ['MyTopic']
}
Even this did not worked - Same Issue.