expo standalone app: notification icons don't show up show up

↘锁芯ラ 提交于 2020-06-12 05:35:39

问题


I have a standalone android and ios app.

currently testing push notifications on android.

I have setup my app.json with the following notification key

"notification":{
      "icon": "./app_assets/icons/icon-48-gs.png",
      "color": "#000000"
    },

the icon above is a 48x48 greyscale icon with transparency. i tried also without color attribute. all i get in both the status bar and in the actual notiification is a white/light grey/black square.

in the expo forums i saw others mention they solved this issue with a 96x96 sized icon. this did not help at all.

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

Can someone please help provide guidance on what the issue might be?


Update per @Raaj Nadar's comment below, Here are the icons i have tried.


回答1:


The official docs of expo is updated with proper information.


The image should be in grayscale meaning black and white! Why?

RGB (32 bit) - This color mode is recommended form displaying images on screen.

CMYK (32 bit) - This color mode is recommended when the image is to be printed.

Grayscale (8 bit) - Only black and white Proper term is monochrome color.

From SDK level 21 colorful images (32 Bit) will be visible in dark gray color or plain white according to the status bar color. From SDK level 21 only grayscale images are recommended by android and 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



来源:https://stackoverflow.com/questions/50607739/expo-standalone-app-notification-icons-dont-show-up-show-up

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!