expo独立应用:通知图标不会显示出来

时间:2018-05-30 14:52:44

标签: react-native expo

我有一个独立的Android和ios应用程序。

目前在Android上测试推送通知。

我已使用以下通知密钥

设置我的app.json
"notification":{
      "icon": "./app_assets/icons/icon-48-gs.png",
      "color": "#000000"
    },

上面的图标是一个48x48灰度图标,带有透明度。 我也试过没有颜色属性。 所有我进入状态栏和实际通知是白色/浅灰色/黑色方块。

grey square only

在世博会论坛中,我看到其他人提到他们用96x96大小的图标解决了这个问题。这根本没有用。

https://forums.expo.io/t/push-notifications-missing-icon-on-android/9170

https://forums.expo.io/t/android-notification-status-bar-icon-too-small/7175

有人可以帮助提供有关问题的指导吗?

根据以下@Raaj Nadar的评论更新,以下是我试过的图标。

enter image description here enter image description here enter image description here enter image description here

1 个答案:

答案 0 :(得分:1)

enter image description here

世博会官方文件更新后会提供适当的信息。

图像应为灰度,表示黑白!为什么?

RGB(32位) - 建议使用此颜色模式在屏幕上显示图像。

CMYK(32位) - 建议在打印图像时使用此颜色模式。

灰度(8位) - 仅黑白正确的术语是单色。

从SDK级别21,根据状态栏颜色,彩色图像(32位)将以深灰色或纯白色显示。从SDK级别21开始,Android和iOS仅推荐使用灰度图像。

Notification icon in Android 5.0 is just a white square

Notification bar icon turns white in Android 5 Lollipop

Check the notification section in docs.expo.io