Pun*_*sal 5 push-notification react-native-firebase
通知人通知图标在通知人显示通知中不起作用
notifee.displayNotification({
title: remoteMessage.notification.title,
body: remoteMessage.notification.body,
android: {
channelId: 'android_id',
},
});
Run Code Online (Sandbox Code Playgroud)
我已经使用了很多东西,例如小图标,大图标和其他方式,但通知图标没有显示,它只是显示默认图像。
我还检查了 AndroidManifest 元数据标签,它们也不起作用。
小资产对规模敏感。因此,如果我们提供自定义图像尺寸,它可能不起作用。最好使用 android studio 的“添加资产”向导来生成和添加。在android节点中,我们只需要添加小图标名称,这是使用android studio添加的。
android: {
smallIcon: 'ic_small_icon',
}
Run Code Online (Sandbox Code Playgroud)
其中,ic_small_icon是通过android studio添加为图像资源的。请点击以下链接通过 android studio 添加 Android 资源。