我正在接收通知,现在使用默认图标。
我想定制它们,但我真的没时间设置图标。
使用
react-native-firebase notifications
.
我已经在网上创建了合适大小的图标
notification icons generator
.
然后我用正确的名字在不同的地方创建了目录,如下所示(Android):
android/app/src/main/res/drawable-mdpi/ (24x24)
android/app/src/main/res/drawable-hdpi/ (36x36)
android/app/src/main/res/drawable-xhdpi/ (48x48)
android/app/src/main/res/drawable-xxhdpi/ (72x72)
android/app/src/main/res/drawable-xxxhdpi/ (96x96)
现在,我想得到正确大小的图像并在这里解决它。
var notification = new firebase.notifications.Notification({
sound: 'default',
show_in_foreground: true,
})
.android.setPriority(firebase.notifications.Android.Priority.High)
.android.setChannelId("channel")
.android.setSmallIcon( <How do I put icon paths here?> );
我读过一些文件和指导方针,但我真的不知道。
引用这些路径的正确方法是什么?